リファクタ
This commit is contained in:
parent
99fb33c79d
commit
2131adfe4a
|
@ -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,19 +119,10 @@ public class ParentMainFragment extends Fragment {
|
||||||
}).join();
|
}).join();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
recyclerView.setAdapter(parentAdapter);
|
recyclerView.setAdapter(parentAdapter);
|
||||||
|
|
||||||
updateTaskInfo();
|
updateTaskInfo();
|
||||||
|
|
||||||
//Pull-to-refresh(スワイプで更新)
|
|
||||||
try {
|
|
||||||
|
|
||||||
swipeRefreshLayout.setOnRefreshListener(() ->{
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user