アダプタ実装 WIP

This commit is contained in:
ろむねこ 2024-01-25 16:35:18 +09:00
parent b44d1b0746
commit 3a47cd97fd
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -6,8 +6,24 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import one.nem.lacerta.model.document.tag.DocumentTag;
public class TagListItemAdapter extends RecyclerView.Adapter<TagListItemAdapter.TagListItemViewHolder> {
ArrayList<DocumentTag> documentTags;
TagListItemSelectListener listener;
public TagListItemAdapter(TagListItemSelectListener listener) {
this.listener = listener;
}
public void setDocumentTags(ArrayList<DocumentTag> documentTags) {
this.documentTags = documentTags;
}
@NonNull
@Override
public TagListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@ -21,7 +37,7 @@ public class TagListItemAdapter extends RecyclerView.Adapter<TagListItemAdapter.
@Override
public int getItemCount() {
return 0;
return documentTags == null ? 0 : documentTags.size();
}
public static class TagListItemViewHolder extends RecyclerView.ViewHolder {