People, I need help, I just can't fix a bug ... I have a RecycleView, the elements of which consist of TextView, ImageView, AnimChackBox. Pictures and text are loaded perfectly, but with AnimCheckBox problems. When you click on AnimCheckBox, the animation starts, while animation is running I quickly scroll the recycle view, new list items appear, on one of them the animation of the old AnimCheckBox ends and freezes, mBinding.setModel (item) updates the image and text, but the checkbox is not updated (remains in a frozen state). I did not find a solution to this problem ...
public class ViewHolder2 extends RecyclerView.ViewHolder { private final ItemListForPersonagesDialogBinding mBinding; public ViewHolder2( ItemListForPersonagesDialogBinding binding) { super(binding.getRoot()); mBinding=binding; } public void bind(final Dossier item) { // item Ρ
ΡΠ°Π½ΠΈΡ isSelected mBinding.setModel(item); mBinding.dialogCheckbox.setOnCheckedChangeListener(null); mBinding.setClick(new PersonagesListClick() { @Override public void onPersonageClick(View view) { if(item.isSelected()==true){ item.setSelected(false); mBinding.dialogCheckbox.setChecked(item.isSelected(),true);// (Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ , Π°Π½ΠΈΠΌΠ°ΡΠΈΡ) return; }else if(item.isSelected()==false){ item.setSelected(true); mBinding.dialogCheckbox.setChecked(item.isSelected(),true); // (Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ , Π°Π½ΠΈΠΌΠ°ΡΠΈΡ) return; } }); } } @BindingAdapter({"bind:android:checked"}) public static void upCB(AnimCheckBox view, boolean isC) { view.setChecked(isC,false); // (Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ , Π°Π½ΠΈΠΌΠ°ΡΠΈΡ) } 