diff options
| author | JosJuice <josjuice@gmail.com> | 2025-06-06 18:46:15 +0200 |
|---|---|---|
| committer | LillyJadeKatrin <lilly.kitty.1988@gmail.com> | 2025-11-08 20:31:22 -0500 |
| commit | f8cddf344d2eda6f2bce6292c3af7a1496687055 (patch) | |
| tree | d1e582aafce3a42d8b72a4a31b7b19c2589dd9b7 /Source/Android/app/src/main/java | |
| parent | 4f849ec8273abfd8290b565264cfe7e422d4961f (diff) | |
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.
Diffstat (limited to 'Source/Android/app/src/main/java')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt index ddcf1d39b5..2907b948b6 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt @@ -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 |
