diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.java deleted file mode 100644 index 621530e980..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.java +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.settings.model.view; - -import android.content.Context; - -import org.dolphinemu.dolphinemu.features.settings.model.AbstractBooleanSetting; -import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; -import org.dolphinemu.dolphinemu.features.settings.model.Settings; - -public final class InvertedSwitchSetting extends SwitchSetting -{ - public InvertedSwitchSetting(Context context, AbstractBooleanSetting setting, int titleId, - int descriptionId) - { - super(context, setting, titleId, descriptionId); - } - - @Override - public boolean isChecked() - { - return !mSetting.getBoolean(); - } - - @Override - public void setChecked(Settings settings, boolean checked) - { - mSetting.setBoolean(settings, !checked); - } - - @Override - public AbstractSetting getSetting() - { - return mSetting; - } -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.kt new file mode 100644 index 0000000000..1a423c62f5 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.kt @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.settings.model.view + +import android.content.Context +import org.dolphinemu.dolphinemu.features.settings.model.AbstractBooleanSetting +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting +import org.dolphinemu.dolphinemu.features.settings.model.Settings + +class InvertedSwitchSetting( + context: Context, + setting: AbstractBooleanSetting, + titleId: Int, + descriptionId: Int +) : SwitchSetting(context, setting, titleId, descriptionId) { + override val setting: AbstractSetting + get() = booleanSetting + + override val isChecked: Boolean + get() = !booleanSetting.boolean + + override fun setChecked(settings: Settings?, checked: Boolean) { + booleanSetting.setBoolean(settings!!, !checked) + } +}