From 232ca60238889356f046f389b3280f6dcd46ce4f Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 17 Dec 2023 14:10:05 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/DebugMenuListItemAdapter.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 feature/debug/src/main/java/one/nem/lacerta/feature/debug/common/adapter/DebugMenuListItemAdapter.java diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/common/adapter/DebugMenuListItemAdapter.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/common/adapter/DebugMenuListItemAdapter.java new file mode 100644 index 00000000..9624ec8e --- /dev/null +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/common/adapter/DebugMenuListItemAdapter.java @@ -0,0 +1,48 @@ +package one.nem.lacerta.feature.debug.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + +import one.nem.lacerta.feature.debug.common.model.DebugMenuListItem; + +public class DebugMenuListItemAdapter extends RecyclerView.Adapter { + private List debugMenuListItems; + + public DebugMenuListItemAdapter(List debugMenuListItems) { + this.debugMenuListItems = debugMenuListItems; + } + + @NonNull + @Override + public DebugMenuListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.debug_menu_item, parent, false); + return new DebugMenuListItemViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull DebugMenuListItemViewHolder holder, int position) { + DebugMenuListItem item = debugMenuListItems.get(position); + holder.title.setText(item.getTitle()); + // Set other views in the holder with data from `item` + } + + @Override + public int getItemCount() { + return debugMenuListItems.size(); + } + + static class DebugMenuListItemViewHolder extends RecyclerView.ViewHolder { + TextView title; + + public DebugMenuListItemViewHolder(@NonNull View itemView) { + super(itemView); + } + } +} \ No newline at end of file