リファクタ

This commit is contained in:
rca 2024-07-06 12:03:55 +09:00
parent 9f8c9690b8
commit ad5fbaf56f

View File

@ -143,9 +143,7 @@ public class SettingMainFragment extends Fragment {
swipeRefreshLayout.setRefreshing(true); swipeRefreshLayout.setRefreshing(true);
return CompletableFuture.allOf(updateParent, updateChildList).thenRun(() -> { return CompletableFuture.allOf(updateParent, updateChildList).thenRun(() -> swipeRefreshLayout.setRefreshing(false));
swipeRefreshLayout.setRefreshing(false);
});
} }
@Override @Override
@ -166,9 +164,7 @@ public class SettingMainFragment extends Fragment {
recyclerView.setAdapter(mainAdapter); recyclerView.setAdapter(mainAdapter);
// ユーザー情報の更新(初回) // ユーザー情報の更新(初回)
updateInfo().thenRunAsync(() -> { updateInfo().thenRunAsync(() -> logger.debug("ユーザー情報の更新完了"));
logger.debug("ユーザー情報の更新完了");
});
return view; return view;
} }
@ -193,13 +189,9 @@ public class SettingMainFragment extends Fragment {
childModel.setName(Objects.requireNonNull(((TextView) dialogView.findViewById(R.id.childNameEditText)).getText()).toString()); childModel.setName(Objects.requireNonNull(((TextView) dialogView.findViewById(R.id.childNameEditText)).getText()).toString());
childData.addChild(childModel).thenAccept(childModel1 -> { // Debug childData.addChild(childModel).thenAccept(childModel1 -> { // Debug
logger.debug("子供を追加しました: " + childModel1.getName()); logger.debug("子供を追加しました: " + childModel1.getName());
}).thenRun(() -> { }).thenRun(() -> updateChildInfo());
updateChildInfo();
});
}) })
.setNeutralButton("閉じる", (dialog, which) -> { .setNeutralButton("閉じる", (dialog, which) -> dialog.cancel()).show();
dialog.cancel();
}).show();
} }
@Override @Override