This commit is contained in:
ろむねこ 2024-07-09 13:42:46 +09:00
parent 42a972855d
commit 39f4316345
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -63,17 +63,15 @@ public class CommonSelectChildFragment extends Fragment {
// 静的解析エラーが発生するのになぜか実行はできる
findNavController(view).navigate(CommonSelectChildFragmentDirections.actionCommonSelectChildFragmentToCommonHomeFragmentParentChild(taskId));
});
childData.getChildListDirect().thenAccept(childList -> {
CompletableFuture.runAsync(() -> childListRecyclerView.setAdapter(adapter)).thenRun(() -> childData.getChildListDirect().thenAccept(childList -> {
requireActivity().runOnUiThread(() -> {
childListRecyclerView.setAdapter(adapter);
adapter.notifyItemRangeRemoved(0, adapter.getItemCount());
adapter.setChildDataList(childList);
adapter.notifyItemRangeInserted(0, childList.size());
adapter.notifyItemRangeChanged(0, childList.size());
});
}).exceptionally(e -> {
logger.error("Failed to load child list");
return null;
});
}));
return view;
}