mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 07:53:15 +00:00
フォルダ削除実装
This commit is contained in:
parent
8f7594c628
commit
841258d82a
|
@ -329,6 +329,20 @@ public class LibraryPageFragment extends Fragment {
|
|||
} else if (item.getItemId() == R.id.menu_item_add_by_media) {
|
||||
createDocByMediaPicker();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.menu_item_delete_folder) {
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext());
|
||||
builder.setTitle("フォルダの削除");
|
||||
builder.setMessage("フォルダを削除しますか?");
|
||||
|
||||
builder.setPositiveButton("削除", (dialog, which) -> {
|
||||
deleteMe();
|
||||
});
|
||||
builder.setNegativeButton("キャンセル", (dialog, which) -> {
|
||||
dialog.cancel();
|
||||
});
|
||||
|
||||
builder.show();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -336,6 +350,12 @@ public class LibraryPageFragment extends Fragment {
|
|||
});
|
||||
}
|
||||
|
||||
private void deleteMe() {
|
||||
lacertaLibrary.deleteFolder(this.folderId).thenAccept(aVoid -> {
|
||||
Navigation.findNavController(requireView()).popBackStack();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* メディアピッカーを使用してドキュメントを作成する(呼び出し部分)
|
||||
*/
|
||||
|
|
|
@ -8,10 +8,15 @@
|
|||
android:title="@string/create_new_folder"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_delete_folder"
|
||||
android:title="このフォルダを削除"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_add_by_media"
|
||||
android:icon="@drawable/developer_mode_24px"
|
||||
android:title="DEBUG_メディアピッカーから新規作成"
|
||||
android:title="DEBUG_MediaPicker"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
</menu>
|
Loading…
Reference in New Issue
Block a user