コールバックにタグを使うように

This commit is contained in:
r-ca 2024-01-29 00:23:18 +09:00
parent d562447777
commit 6847af9b9a
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -17,8 +17,8 @@ public class LacertaApplyTagAdapter extends RecyclerView.Adapter<LacertaApplyTag
// Listener
public interface LacertaApplyTagDialogListener {
void itemChecked(View view, int position);
void itemUnchecked(View view, int position);
void itemChecked(View view, String tagId);
void itemUnchecked(View view, String tagId);
}
// Variables
@ -54,9 +54,9 @@ public class LacertaApplyTagAdapter extends RecyclerView.Adapter<LacertaApplyTag
holder.checkBox.setChecked(documentTag.getIsChecked());
holder.checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (isChecked) {
listener.itemChecked(buttonView, position);
listener.itemChecked(buttonView, documentTag.getId());
} else {
listener.itemUnchecked(buttonView, position);
listener.itemUnchecked(buttonView, documentTag.getId());
}
});
}