feature/fix_fab #148
|
@ -122,6 +122,9 @@ public class CommonHomeFragment extends Fragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 親モードの場合(=子供モードではない場合)のFABの設定
|
||||||
|
*/
|
||||||
private void setupFabParent() {
|
private void setupFabParent() {
|
||||||
fabManager.show();
|
fabManager.show();
|
||||||
fabManager.setFabEventCallback(new FabEventCallback() {
|
fabManager.setFabEventCallback(new FabEventCallback() {
|
||||||
|
@ -137,10 +140,19 @@ public class CommonHomeFragment extends Fragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子供モードの場合のFABの設定
|
||||||
|
*/
|
||||||
private void setupFabChild() {
|
private void setupFabChild() {
|
||||||
fabManager.hide();
|
fabManager.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* タスク完了確認ダイアログを表示 (子供モード用)
|
||||||
|
*
|
||||||
|
* @param taskName タスク名
|
||||||
|
* @return OKボタンが押されたかどうか
|
||||||
|
*/
|
||||||
private boolean showConfirmDialog(String taskName) {
|
private boolean showConfirmDialog(String taskName) {
|
||||||
AtomicBoolean selection = new AtomicBoolean(false);
|
AtomicBoolean selection = new AtomicBoolean(false);
|
||||||
new MaterialAlertDialogBuilder(requireContext())
|
new MaterialAlertDialogBuilder(requireContext())
|
||||||
|
@ -158,6 +170,12 @@ public class CommonHomeFragment extends Fragment {
|
||||||
return selection.get();
|
return selection.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* タスク完了ダイアログ(子供選択画面)を表示 (親モード用)
|
||||||
|
*
|
||||||
|
* @param taskId タスクID
|
||||||
|
* @param taskName タスク名
|
||||||
|
*/
|
||||||
private void showChildSelectDialog(String taskId, String taskName) { // TODO: Assignされている子供かどうかを考慮するように
|
private void showChildSelectDialog(String taskId, String taskName) { // TODO: Assignされている子供かどうかを考慮するように
|
||||||
RecyclerView childListRecyclerView = new RecyclerView(requireContext());
|
RecyclerView childListRecyclerView = new RecyclerView(requireContext());
|
||||||
childListRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
childListRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
@ -179,6 +197,10 @@ public class CommonHomeFragment extends Fragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* タスク情報を更新
|
||||||
|
* @return CompletableFuture<Void>
|
||||||
|
*/
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
private CompletableFuture<Void> updateTaskInfo() { // TODO: updatedの場合の処理など実装
|
private CompletableFuture<Void> updateTaskInfo() { // TODO: updatedの場合の処理など実装
|
||||||
return taskData.getTasks(new TaskItemModelCallback() {
|
return taskData.getTasks(new TaskItemModelCallback() {
|
||||||
|
@ -201,11 +223,18 @@ public class CommonHomeFragment extends Fragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* カレンダーを更新
|
||||||
|
* @return CompletableFuture<Void>
|
||||||
|
*/
|
||||||
private CompletableFuture<Void> updateCalender() {
|
private CompletableFuture<Void> updateCalender() {
|
||||||
// TODO: タスクの完了状況をカレンダーに表示
|
// TODO: タスクの完了状況をカレンダーに表示
|
||||||
return CompletableFuture.completedFuture(null);
|
return CompletableFuture.completedFuture(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* データを更新 (updateTaskInfoとupdateCalenderを並列実行)
|
||||||
|
*/
|
||||||
private void updateData() {
|
private void updateData() {
|
||||||
swipeRefreshLayout.setRefreshing(true);
|
swipeRefreshLayout.setRefreshing(true);
|
||||||
CompletableFuture.allOf(updateTaskInfo(), updateCalender()).thenRun(() -> {
|
CompletableFuture.allOf(updateTaskInfo(), updateCalender()).thenRun(() -> {
|
||||||
|
@ -219,6 +248,9 @@ public class CommonHomeFragment extends Fragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* タスク追加ダイアログを表示
|
||||||
|
*/
|
||||||
private void showAddTaskDialog() {
|
private void showAddTaskDialog() {
|
||||||
new MaterialAlertDialogBuilder(requireContext())
|
new MaterialAlertDialogBuilder(requireContext())
|
||||||
.setTitle("Placeholder")
|
.setTitle("Placeholder")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user