Adapter修正

This commit is contained in:
r-ca 2023-12-17 14:34:10 +09:00
parent 975b3abd98
commit 1b6df08df8
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -1,5 +1,6 @@
package one.nem.lacerta.feature.debug.common.adapter;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -13,6 +14,7 @@ import java.util.List;
import one.nem.lacerta.feature.debug.R;
import one.nem.lacerta.feature.debug.common.model.DebugMenuListItem;
import one.nem.lacerta.utils.LacertaLogger;
public class DebugMenuListItemAdapter extends RecyclerView.Adapter<DebugMenuListItemAdapter.DebugMenuListItemViewHolder> {
private List<DebugMenuListItem> debugMenuListItems;
@ -31,7 +33,10 @@ public class DebugMenuListItemAdapter extends RecyclerView.Adapter<DebugMenuList
@Override
public void onBindViewHolder(@NonNull DebugMenuListItemViewHolder holder, int position) {
DebugMenuListItem item = debugMenuListItems.get(position);
Log.d("DebugMenuListItemAdapter", "onBindViewHolder: " + item.getTitle()); // TODO: Remove
// Set title
holder.title.setText(item.getTitle());
// Set description
holder.description.setText(item.getDescription());
holder.itemView.setOnClickListener( v -> {
@ -50,6 +55,10 @@ public class DebugMenuListItemAdapter extends RecyclerView.Adapter<DebugMenuList
public DebugMenuListItemViewHolder(@NonNull View itemView) {
super(itemView);
// Get ref to views
title = itemView.findViewById(R.id.debug_menu_item_title);
description = itemView.findViewById(R.id.debug_menu_item_description);
}
}
}