From 17c7b5b67508641144d97cd5259a20f288281df2 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 17 Dec 2023 13:20:59 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=83=80=E3=83=97=E3=82=BF=E5=AE=9F?= =?UTF-8?q?=E8=A3=85WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../debug/DebugDocumentMenuAdapter.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugDocumentMenuAdapter.java diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugDocumentMenuAdapter.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugDocumentMenuAdapter.java new file mode 100644 index 00000000..305d3e0e --- /dev/null +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugDocumentMenuAdapter.java @@ -0,0 +1,46 @@ +package one.nem.lacerta.feature.debug; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.navigation.Navigation; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + +import one.nem.lacerta.feature.debug.common.model.SettingMenuItem; + +public class DebugDocumentMenuAdapter extends RecyclerView.Adapter { + + private List menuItems; + + public DebugDocumentMenuAdapter(List menuItems) { + this.menuItems = menuItems; + } + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return null; + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + SettingMenuItem menuItem = menuItems.get(position); + holder.itemView.setOnClickListener( v -> { + Navigation.findNavController(v).navigate(menuItem.getDestinationId()); + }); + } + + @Override + public int getItemCount() { + return menuItems.size(); + } + + public class ViewHolder extends RecyclerView.ViewHolder { + public ViewHolder(@NonNull View itemView) { + super(itemView); + } + } +}