リファクタ

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