diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/ClearAllDataDialog.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/ClearAllDataDialog.kt index 560c137104..fa3be71307 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/ClearAllDataDialog.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/ClearAllDataDialog.kt @@ -42,6 +42,7 @@ class ClearAllDataDialog : BaseDialog() { var selectedOption = device val optionAdapter = RadioOptionAdapter { selectedOption = it } binding.recyclerView.apply { + itemAnimator = null adapter = optionAdapter addItemDecoration(DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL)) setHasFixedSize(true) diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt index 2cb61a0e82..4bb69c4c14 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt @@ -16,8 +16,8 @@ class RadioOptionAdapter( ) : ListAdapter(RadioOptionDiffer()) { class RadioOptionDiffer: DiffUtil.ItemCallback() { - override fun areItemsTheSame(oldItem: RadioOption, newItem: RadioOption) = oldItem === newItem - override fun areContentsTheSame(oldItem: RadioOption, newItem: RadioOption) = oldItem == newItem + override fun areItemsTheSame(oldItem: RadioOption, newItem: RadioOption) = oldItem.title == newItem.title + override fun areContentsTheSame(oldItem: RadioOption, newItem: RadioOption) = oldItem.value == newItem.value } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { @@ -31,7 +31,7 @@ class RadioOptionAdapter( holder.bind(option, isSelected) { onClickListener(it) selectedOptionPosition = position - notifyDataSetChanged() + notifyItemRangeChanged(0, itemCount) } }