mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
Merge pull request #11369 from t895/switch-fix
Android: Allow users to interact with switches in settings
This commit is contained in:
commit
b3bc9c41ea
@ -33,6 +33,15 @@ public final class SwitchSettingViewHolder extends SettingViewHolder
|
|||||||
|
|
||||||
mBinding.settingSwitch.setChecked(mItem.isChecked(getAdapter().getSettings()));
|
mBinding.settingSwitch.setChecked(mItem.isChecked(getAdapter().getSettings()));
|
||||||
|
|
||||||
|
mBinding.settingSwitch.setEnabled(mItem.isEditable());
|
||||||
|
|
||||||
|
mBinding.settingSwitch.setOnCheckedChangeListener((buttonView, isChecked) ->
|
||||||
|
{
|
||||||
|
getAdapter().onBooleanClick(mItem, mBinding.settingSwitch.isChecked());
|
||||||
|
|
||||||
|
setStyle(mBinding.textSettingName, mItem);
|
||||||
|
});
|
||||||
|
|
||||||
setStyle(mBinding.textSettingName, mItem);
|
setStyle(mBinding.textSettingName, mItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,10 +55,6 @@ public final class SwitchSettingViewHolder extends SettingViewHolder
|
|||||||
}
|
}
|
||||||
|
|
||||||
mBinding.settingSwitch.toggle();
|
mBinding.settingSwitch.toggle();
|
||||||
|
|
||||||
getAdapter().onBooleanClick(mItem, mBinding.settingSwitch.isChecked());
|
|
||||||
|
|
||||||
setStyle(mBinding.textSettingName, mItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable @Override
|
@Nullable @Override
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:clickable="false"
|
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:minHeight="0dp"
|
android:minHeight="0dp"
|
||||||
android:minWidth="0dp" />
|
android:minWidth="0dp" />
|
||||||
|
Loading…
Reference in New Issue
Block a user