mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
拡張モデルを使うようにアダプタを修正
This commit is contained in:
parent
425616c335
commit
d562447777
|
@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import one.nem.lacerta.component.common.model.DocumentTagApplyTagDialogExtendedModel;
|
||||||
import one.nem.lacerta.model.document.tag.DocumentTag;
|
import one.nem.lacerta.model.document.tag.DocumentTag;
|
||||||
|
|
||||||
public class LacertaApplyTagAdapter extends RecyclerView.Adapter<LacertaApplyTagAdapter.LacertaApplyTagViewHolder>{
|
public class LacertaApplyTagAdapter extends RecyclerView.Adapter<LacertaApplyTagAdapter.LacertaApplyTagViewHolder>{
|
||||||
|
@ -21,7 +22,7 @@ public class LacertaApplyTagAdapter extends RecyclerView.Adapter<LacertaApplyTag
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
private ArrayList<DocumentTag> documentTagArrayList;
|
private ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList;
|
||||||
private LacertaApplyTagDialogListener listener;
|
private LacertaApplyTagDialogListener listener;
|
||||||
|
|
||||||
// Setter
|
// Setter
|
||||||
|
@ -30,14 +31,13 @@ public class LacertaApplyTagAdapter extends RecyclerView.Adapter<LacertaApplyTag
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LacertaApplyTagAdapter setDocumentTagArrayList(ArrayList<DocumentTag> documentTagArrayList) {
|
public LacertaApplyTagAdapter setDocumentTagArrayList(ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList) {
|
||||||
this.documentTagArrayList = documentTagArrayList;
|
this.documentTagArrayList = documentTagArrayList;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Empty constructor
|
||||||
public LacertaApplyTagAdapter(ArrayList<DocumentTag> documentTagArrayList) {
|
public LacertaApplyTagAdapter() {
|
||||||
this.documentTagArrayList = documentTagArrayList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
@ -49,8 +49,9 @@ public class LacertaApplyTagAdapter extends RecyclerView.Adapter<LacertaApplyTag
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull LacertaApplyTagAdapter.LacertaApplyTagViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull LacertaApplyTagAdapter.LacertaApplyTagViewHolder holder, int position) {
|
||||||
DocumentTag documentTag = documentTagArrayList.get(position);
|
DocumentTagApplyTagDialogExtendedModel documentTag = documentTagArrayList.get(position);
|
||||||
holder.checkBox.setText(documentTag.getName());
|
holder.checkBox.setText(documentTag.getName());
|
||||||
|
holder.checkBox.setChecked(documentTag.getIsChecked());
|
||||||
holder.checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
holder.checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
listener.itemChecked(buttonView, position);
|
listener.itemChecked(buttonView, position);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user