diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java index f8f562f1..39d9cf13 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java @@ -39,8 +39,8 @@ public class LacertaApplyTagDialog extends DialogFragment { // Listener public interface LacertaApplyTagDialogListener { - void onDialogPositiveClick(DialogFragment dialog); - void onDialogNegativeClick(DialogFragment dialog); + void onDialogPositiveClick(ArrayList appliedTags); + void onDialogNegativeClick(); } // Variables @@ -121,11 +121,11 @@ public class LacertaApplyTagDialog extends DialogFragment { .setView(view) .setPositiveButton(positiveButtonText == null ? "OK" : positiveButtonText, (dialog, id) -> { // Send the positive button event back to the host activity - listener.onDialogPositiveClick(LacertaApplyTagDialog.this); + listener.onDialogPositiveClick(this.appliedTags); }) .setNegativeButton(negativeButtonText == null ? "Cancel" : negativeButtonText, (dialog, id) -> { // Send the negative button event back to the host activity - listener.onDialogNegativeClick(LacertaApplyTagDialog.this); + listener.onDialogNegativeClick(); }); return builder.create(); } diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java index da799b80..8f91f666 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java @@ -19,6 +19,8 @@ import com.google.android.material.tabs.TabLayoutMediator; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; +import java.util.ArrayList; + import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; @@ -27,6 +29,7 @@ import one.nem.lacerta.component.common.picker.LacertaFilePickerDialog; import one.nem.lacerta.data.Document; import one.nem.lacerta.data.LacertaLibrary; import one.nem.lacerta.model.document.page.Page; +import one.nem.lacerta.model.document.tag.DocumentTag; import one.nem.lacerta.model.pref.ToxiDocumentModel; import one.nem.lacerta.utils.LacertaLogger; @@ -205,6 +208,17 @@ public class ViewerContainerFragment extends Fragment { .setMessage("タグを適用するファイルを選択してください") .setNegativeButtonText("キャンセル") .setDocumentId(documentId) + .setListener(new LacertaApplyTagDialog.LacertaApplyTagDialogListener() { + @Override + public void onDialogPositiveClick(ArrayList appliedTags) { + // 適用 + } + + @Override + public void onDialogNegativeClick() { + lacertaApplyTagDialog.dismiss(); + } + }) .show(getChildFragmentManager(), "LacertaApplyTagDialog"); }