mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Adapter修正
This commit is contained in:
parent
a3b3000d59
commit
a8ee792928
|
@ -1,5 +1,7 @@
|
||||||
package one.nem.lacerta.component.common.picker;
|
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.component.common.picker.base.LacertaFilePickerAdapterBase;
|
||||||
import one.nem.lacerta.model.ListItem;
|
import one.nem.lacerta.model.ListItem;
|
||||||
import one.nem.lacerta.model.ListItemType;
|
import one.nem.lacerta.model.ListItemType;
|
||||||
|
@ -9,6 +11,7 @@ public class LacertaFilePickerAdapter extends LacertaFilePickerAdapterBase {
|
||||||
// Listener
|
// Listener
|
||||||
public interface LacertaFilePickerAdapterListener extends LacertaFilePickerAdapterBase.LacertaFilePickerAdapterListener {
|
public interface LacertaFilePickerAdapterListener extends LacertaFilePickerAdapterBase.LacertaFilePickerAdapterListener {
|
||||||
void onDocumentSelected(String documentId);
|
void onDocumentSelected(String documentId);
|
||||||
|
void onCombinedDocumentSelected(String documentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
@ -24,6 +27,11 @@ public class LacertaFilePickerAdapter extends LacertaFilePickerAdapterBase {
|
||||||
public void onBindViewHolder(LacertaFilePickerViewHolder holder, int position) {
|
public void onBindViewHolder(LacertaFilePickerViewHolder holder, int position) {
|
||||||
super.onBindViewHolder(holder, position);
|
super.onBindViewHolder(holder, position);
|
||||||
if (libraryItemPage.getListItems().get(position).getItemType() == ListItemType.ITEM_TYPE_DOCUMENT) {
|
if (libraryItemPage.getListItems().get(position).getItemType() == ListItemType.ITEM_TYPE_DOCUMENT) {
|
||||||
|
if (libraryItemPage.getListItems().get(position).getHasCombined()) {
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
listener.onCombinedDocumentSelected(libraryItemPage.getListItems().get(position).getItemId());
|
||||||
|
});
|
||||||
|
} else {
|
||||||
holder.itemView.setOnClickListener(v -> {
|
holder.itemView.setOnClickListener(v -> {
|
||||||
ListItem listItem = libraryItemPage.getListItems().get(position);
|
ListItem listItem = libraryItemPage.getListItems().get(position);
|
||||||
listener.onDocumentSelected(listItem.getItemId());
|
listener.onDocumentSelected(listItem.getItemId());
|
||||||
|
@ -31,3 +39,4 @@ public class LacertaFilePickerAdapter extends LacertaFilePickerAdapterBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user