レイアウト修正

This commit is contained in:
r-ca 2023-12-17 14:10:05 +09:00
parent 021650f064
commit 232ca60238
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -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<DebugMenuListItemAdapter.DebugMenuListItemViewHolder> {
private List<DebugMenuListItem> debugMenuListItems;
public DebugMenuListItemAdapter(List<DebugMenuListItem> 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);
}
}
}