From 383a7020ce68a2766da3eb9d65980cb909914466 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 28 Jan 2024 11:02:44 +0900 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerListFragment.java | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 349bc99a..65518a10 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -23,6 +23,7 @@ import one.nem.lacerta.component.common.LacertaSelectDirDialog; import one.nem.lacerta.component.common.LacertaSelectDirDialogListener; import one.nem.lacerta.component.common.LacertaSelectRevDialog; import one.nem.lacerta.component.common.LacertaSelectRevDialogListener; +import one.nem.lacerta.component.common.picker.LacertaDirPickerDialog; import one.nem.lacerta.data.Document; import one.nem.lacerta.data.LacertaLibrary; import one.nem.lacerta.model.ListItemType; @@ -239,29 +240,21 @@ public class ViewerListFragment extends Fragment { builder.show(); return true; } else if (item.getItemId() == R.id.action_move) { - LacertaSelectDirDialog lacertaSelectDirDialog = new LacertaSelectDirDialog(); - lacertaSelectDirDialog.setListener(new LacertaSelectDirDialogListener() { - @Override - public void onDirSelected(String name, String itemId) { - logger.debug(TAG, "Selected dir: " + name + ", " + itemId); - document.moveDocument(documentId, itemId).thenAccept(aVoid -> { - getActivity().runOnUiThread(() -> { - // Stop Activity - getActivity().finish(); // TODO-rca: ファイル移動後に終了するべきかは検討 - }); + LacertaDirPickerDialog lacertaDirPickerDialog = new LacertaDirPickerDialog(); + lacertaDirPickerDialog.setListener((name, dirId) -> { + logger.debug(TAG, "Selected dir: " + name + ", " + dirId); + document.moveDocument(documentId, dirId).thenAccept(aVoid -> { + getActivity().runOnUiThread(() -> { + // Stop Activity + getActivity().finish(); // TODO-rca: ファイル移動後に終了するべきかは検討 }); - } - - @Override - public void onCanceled() { - logger.debug(TAG, "Canceled"); - } + }); }); - lacertaSelectDirDialog.setTitle("ファイルの移動") - .setMessage("ファイルを移動するフォルダを選択してください。") - .setPositiveButtonText("移動") - .setNegativeButtonText("キャンセル"); - lacertaSelectDirDialog.show(getParentFragmentManager(), "select_dir_dialog"); + lacertaDirPickerDialog.setTitle("ファイルの移動") + .setMessage("ファイルを移動するフォルダを選択してください。") + .setPositiveButtonText("移動") + .setNegativeButtonText("キャンセル"); + lacertaDirPickerDialog.show(getParentFragmentManager(), "select_dir_dialog"); return true; } else { return false;