diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerAdapterBase.java b/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerAdapterBase.java index 551a2b69..e21b7c17 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerAdapterBase.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerAdapterBase.java @@ -9,19 +9,24 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import one.nem.lacerta.component.common.LacertaSelectDirDialogInternalEventListener; import one.nem.lacerta.model.LibraryItemPage; import one.nem.lacerta.model.ListItem; import one.nem.lacerta.model.ListItemType; public class LacertaFilePickerAdapterBase extends RecyclerView.Adapter { + // Listener + public interface LacertaFilePickerAdapterListener { + void onItemSelected(String dirId); + void onBackSelected(String dirId); + } private LibraryItemPage libraryItemPage; - LacertaSelectDirDialogInternalEventListener listener; - public LacertaFilePickerAdapterBase(LacertaSelectDirDialogInternalEventListener listener) { - this.listener = listener; + private LacertaFilePickerAdapterListener listener; + + // Empty constructor + public LacertaFilePickerAdapterBase() { } public void setListItems(LibraryItemPage libraryItemPage) { @@ -31,6 +36,10 @@ public class LacertaFilePickerAdapterBase extends RecyclerView.Adapter listener.onBackSelected(this.libraryItemPage.getParentId())); } else { - holder.itemView.setOnClickListener(v -> listener.onDirSelected(listItem.getTitle(), listItem.getItemId())); + holder.itemView.setOnClickListener(v -> listener.onItemSelected(listItem.getItemId())); } } diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerDialogBase.java b/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerDialogBase.java index 973a41af..0003f11e 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerDialogBase.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/picker/base/LacertaFilePickerDialogBase.java @@ -48,9 +48,7 @@ public class LacertaFilePickerDialogBase extends DialogFragment { } // Methods - protected void updateList(LacertaFilePickerAdapterBase adapter, LibraryItemPage libraryItemPage) { - int currentCount = adapter.getItemCount(); - String currentDirId = adapter.getCurrentId(); + protected void updateList(LacertaFilePickerAdapterBase adapter, LibraryItemPage libraryItemPage, int currentCount, String currentDirId) { if (currentDirId == null) { // Rootが関わる推移 (Rootからの推移) adapter.setListItems(libraryItemPage);