From a8ee7929289e111b7c708f304f14d951b9b567ea Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 29 Jan 2024 04:38:00 +0900 Subject: [PATCH] =?UTF-8?q?Adapter=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/picker/LacertaFilePickerAdapter.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/picker/LacertaFilePickerAdapter.java b/component/common/src/main/java/one/nem/lacerta/component/common/picker/LacertaFilePickerAdapter.java index fa0163d2..29fd3eec 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/picker/LacertaFilePickerAdapter.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/picker/LacertaFilePickerAdapter.java @@ -1,5 +1,7 @@ package one.nem.lacerta.component.common.picker; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import one.nem.lacerta.component.common.picker.base.LacertaFilePickerAdapterBase; import one.nem.lacerta.model.ListItem; import one.nem.lacerta.model.ListItemType; @@ -9,6 +11,7 @@ public class LacertaFilePickerAdapter extends LacertaFilePickerAdapterBase { // Listener public interface LacertaFilePickerAdapterListener extends LacertaFilePickerAdapterBase.LacertaFilePickerAdapterListener { void onDocumentSelected(String documentId); + void onCombinedDocumentSelected(String documentId); } // Variables @@ -24,10 +27,16 @@ public class LacertaFilePickerAdapter extends LacertaFilePickerAdapterBase { public void onBindViewHolder(LacertaFilePickerViewHolder holder, int position) { super.onBindViewHolder(holder, position); if (libraryItemPage.getListItems().get(position).getItemType() == ListItemType.ITEM_TYPE_DOCUMENT) { - holder.itemView.setOnClickListener(v -> { - ListItem listItem = libraryItemPage.getListItems().get(position); - listener.onDocumentSelected(listItem.getItemId()); - }); + if (libraryItemPage.getListItems().get(position).getHasCombined()) { + holder.itemView.setOnClickListener(v -> { + listener.onCombinedDocumentSelected(libraryItemPage.getListItems().get(position).getItemId()); + }); + } else { + holder.itemView.setOnClickListener(v -> { + ListItem listItem = libraryItemPage.getListItems().get(position); + listener.onDocumentSelected(listItem.getItemId()); + }); + } } } }