リファクタ

This commit is contained in:
rca 2024-07-06 13:18:27 +09:00
parent 99fb33c79d
commit 2131adfe4a

View File

@ -93,8 +93,6 @@ public class ParentMainFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
// Inflate the layout for this fragment // Inflate the layout for this fragment
//タスク一覧表示
View view = inflater.inflate(R.layout.fragment_parent_main, container, false); View view = inflater.inflate(R.layout.fragment_parent_main, container, false);
swipeRefreshLayout = view.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout = view.findViewById(R.id.swipe_refresh_layout);
@ -121,18 +119,9 @@ public class ParentMainFragment extends Fragment {
}).join(); }).join();
}); });
recyclerView.setAdapter(parentAdapter); recyclerView.setAdapter(parentAdapter);
updateTaskInfo();
//Pull-to-refreshスワイプで更新
try {
swipeRefreshLayout.setOnRefreshListener(() ->{
updateTaskInfo(); updateTaskInfo();
});
} catch (Exception e){
}
return view; return view;
} }
@ -166,5 +155,8 @@ public class ParentMainFragment extends Fragment {
// Do nothing // Do nothing
} }
}); });
// SwipeToRefresh
swipeRefreshLayout.setOnRefreshListener(this::updateTaskInfo);
} }
} }