mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Android: Clear listener in SwitchSettingViewHolder
If bind was called more than once for a SwitchSettingViewHolder, the line `binding.settingSwitch.isChecked = setting.isChecked` would accidentally trigger the listener registered during the previous bind call.
This commit is contained in:
parent
4f849ec827
commit
f8cddf344d
@ -32,6 +32,9 @@ class SwitchSettingViewHolder(
|
||||
binding.textSettingName.text = item.name
|
||||
binding.textSettingDescription.text = item.description
|
||||
|
||||
// Make sure we don't trigger any listener set earlier
|
||||
binding.settingSwitch.setOnCheckedChangeListener(null)
|
||||
|
||||
binding.settingSwitch.isChecked = setting.isChecked
|
||||
binding.settingSwitch.isEnabled = setting.isEditable
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user