From 5bc2b469836ed35f95e6a6ffec925eac6f79702c Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 15 Mar 2023 03:23:01 -0400 Subject: [PATCH] Android: Convert AbstractBooleanSetting to Kotlin --- .../cheats/ui/SettingDisabledWarningFragment.kt | 2 +- .../settings/model/AbstractBooleanSetting.java | 12 ------------ .../settings/model/AbstractBooleanSetting.kt | 9 +++++++++ 3 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt index 737a931a85..538f4144e8 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt @@ -43,7 +43,7 @@ abstract class SettingDisabledWarningFragment( super.onResume() val activity = requireActivity() as CheatsActivity activity.loadGameSpecificSettings().use { - val cheatsEnabled = setting.getBoolean() + val cheatsEnabled = setting.boolean requireView().visibility = if (cheatsEnabled) View.GONE else View.VISIBLE } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java deleted file mode 100644 index 22d757d4c6..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.settings.model; - -import androidx.annotation.NonNull; - -public interface AbstractBooleanSetting extends AbstractSetting -{ - boolean getBoolean(); - - void setBoolean(@NonNull Settings settings, boolean newValue); -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.kt new file mode 100644 index 0000000000..6196597dac --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.kt @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.settings.model + +interface AbstractBooleanSetting : AbstractSetting { + val boolean: Boolean + + fun setBoolean(settings: Settings, newValue: Boolean) +}