mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
Adapter修正
This commit is contained in:
parent
975b3abd98
commit
1b6df08df8
|
@ -1,5 +1,6 @@
|
||||||
package one.nem.lacerta.feature.debug.common.adapter;
|
package one.nem.lacerta.feature.debug.common.adapter;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
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.R;
|
||||||
import one.nem.lacerta.feature.debug.common.model.DebugMenuListItem;
|
import one.nem.lacerta.feature.debug.common.model.DebugMenuListItem;
|
||||||
|
import one.nem.lacerta.utils.LacertaLogger;
|
||||||
|
|
||||||
public class DebugMenuListItemAdapter extends RecyclerView.Adapter<DebugMenuListItemAdapter.DebugMenuListItemViewHolder> {
|
public class DebugMenuListItemAdapter extends RecyclerView.Adapter<DebugMenuListItemAdapter.DebugMenuListItemViewHolder> {
|
||||||
private List<DebugMenuListItem> debugMenuListItems;
|
private List<DebugMenuListItem> debugMenuListItems;
|
||||||
|
@ -31,7 +33,10 @@ public class DebugMenuListItemAdapter extends RecyclerView.Adapter<DebugMenuList
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull DebugMenuListItemViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull DebugMenuListItemViewHolder holder, int position) {
|
||||||
DebugMenuListItem item = debugMenuListItems.get(position);
|
DebugMenuListItem item = debugMenuListItems.get(position);
|
||||||
|
Log.d("DebugMenuListItemAdapter", "onBindViewHolder: " + item.getTitle()); // TODO: Remove
|
||||||
|
// Set title
|
||||||
holder.title.setText(item.getTitle());
|
holder.title.setText(item.getTitle());
|
||||||
|
// Set description
|
||||||
holder.description.setText(item.getDescription());
|
holder.description.setText(item.getDescription());
|
||||||
|
|
||||||
holder.itemView.setOnClickListener( v -> {
|
holder.itemView.setOnClickListener( v -> {
|
||||||
|
@ -50,6 +55,10 @@ public class DebugMenuListItemAdapter extends RecyclerView.Adapter<DebugMenuList
|
||||||
|
|
||||||
public DebugMenuListItemViewHolder(@NonNull View itemView) {
|
public DebugMenuListItemViewHolder(@NonNull View itemView) {
|
||||||
super(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user