mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-15 04:40:08 +00:00
android: Set switch listener before assigning new value
Previously the switch could have its old listener triggered when recycled.
This commit is contained in:
parent
26ff214719
commit
0d4bf53ad9
@ -25,10 +25,10 @@ class SwitchSettingViewHolder(val binding: ListItemSettingSwitchBinding, adapter
|
||||
binding.textSettingDescription.text = ""
|
||||
binding.textSettingDescription.visibility = View.GONE
|
||||
}
|
||||
binding.switchWidget.isChecked = setting.isChecked
|
||||
binding.switchWidget.setOnCheckedChangeListener { _: CompoundButton, _: Boolean ->
|
||||
adapter.onBooleanClick(item, bindingAdapterPosition, binding.switchWidget.isChecked)
|
||||
}
|
||||
binding.switchWidget.isChecked = setting.isChecked
|
||||
|
||||
binding.switchWidget.isEnabled = setting.isEditable
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user