mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
deleteDocument実装
This commit is contained in:
parent
732f599df9
commit
9861dfe5b6
|
@ -244,7 +244,7 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
renameDocument();
|
renameDocument();
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_delete) {
|
} else if (item.getItemId() == R.id.action_delete) {
|
||||||
Toast.makeText(getContext(), "Work in progress", Toast.LENGTH_SHORT).show();
|
deleteDocument();
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_move) {
|
} else if (item.getItemId() == R.id.action_move) {
|
||||||
Toast.makeText(getContext(), "Work in progress", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "Work in progress", Toast.LENGTH_SHORT).show();
|
||||||
|
@ -281,6 +281,26 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
lacertaSelectRevDialog.show(getParentFragmentManager(), "select_rev_dialog");
|
lacertaSelectRevDialog.show(getParentFragmentManager(), "select_rev_dialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteDocument() {
|
||||||
|
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
|
||||||
|
builder.setTitle("ファイルの削除");
|
||||||
|
builder.setMessage("ファイルを削除しますか?");
|
||||||
|
|
||||||
|
builder.setPositiveButton("削除", (dialog, which) -> {
|
||||||
|
document.deleteDocument(documentId).thenAccept(aVoid -> {
|
||||||
|
getActivity().runOnUiThread(() -> {
|
||||||
|
Toast.makeText(getContext(), "削除しました", Toast.LENGTH_SHORT).show();
|
||||||
|
getActivity().finish(); // TODO-rca: 終了させずにUIを更新したい
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
builder.setNegativeButton("キャンセル", (dialog, which) -> {
|
||||||
|
dialog.cancel();
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
|
||||||
private void applyTag() {
|
private void applyTag() {
|
||||||
LacertaApplyTagDialog lacertaApplyTagDialog = new LacertaApplyTagDialog();
|
LacertaApplyTagDialog lacertaApplyTagDialog = new LacertaApplyTagDialog();
|
||||||
lacertaApplyTagDialog
|
lacertaApplyTagDialog
|
||||||
|
|
Loading…
Reference in New Issue
Block a user