mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
onBindViewHolder実装
This commit is contained in:
parent
c9dbefbe38
commit
24632351ed
|
@ -3,6 +3,7 @@ package one.nem.lacerta.feature.debug.common.adapter;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
@ -28,7 +29,18 @@ public class DebugMenuDocumentListItemAdapter extends RecyclerView.Adapter<Debug
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull DebugMenuDocumentListItemAdapter.DebugMenuDocumentListItemViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull DebugMenuDocumentListItemAdapter.DebugMenuDocumentListItemViewHolder holder, int position) {
|
||||||
|
DebugMenuDocumentListItem item = debugMenuDocumentListItems.get(position);
|
||||||
|
|
||||||
|
// Set title
|
||||||
|
holder.title.setText(item.getTitle());
|
||||||
|
// Set description
|
||||||
|
holder.description.setText(item.getDescription());
|
||||||
|
// Set updated at
|
||||||
|
holder.updatedAt.setText("Updated at: " + item.getUpdatedAt());
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
Toast.makeText(v.getContext(), "Clicked on " + item.getTitle(), Toast.LENGTH_SHORT).show(); // Debug
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user