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