From bdf6bae5faa398de82cc80bdd0d59f7d4f76b3ed Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 29 Jan 2024 05:20:49 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerBodyFragment.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyFragment.java index 69912bea..82c98341 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyFragment.java @@ -11,6 +11,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Toast; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; @@ -101,7 +103,18 @@ public class ViewerBodyFragment extends Fragment { @Override public void onItemLongClick(String fileName, int position) { + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); + builder.setTitle("ページを更新しますか?"); + builder.setPositiveButton("更新", (dialog, which) -> { + // update + }); + builder.setNegativeButton("キャンセル", (dialog, which) -> { + // cancel + dialog.dismiss(); + }); + + builder.show(); } }); recyclerView.setAdapter(viewerBodyAdapter);