From 21e0b5b9d9acf793c39254cba594dfeef99a6254 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 15 Mar 2023 03:22:38 -0400 Subject: [PATCH] Android: Convert AbstractSetting to Kotlin --- .../features/settings/model/AbstractSetting.java | 14 -------------- .../features/settings/model/AbstractSetting.kt | 10 ++++++++++ .../features/settings/model/ScaledIntSetting.kt | 10 ++++------ 3 files changed, 14 insertions(+), 20 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java deleted file mode 100644 index 9ffaf20544..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.settings.model; - -import androidx.annotation.NonNull; - -public interface AbstractSetting -{ - boolean isOverridden(); - - boolean isRuntimeEditable(); - - boolean delete(@NonNull Settings settings); -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.kt new file mode 100644 index 0000000000..6afcfab2e4 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.kt @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.settings.model + +interface AbstractSetting { + val isOverridden: Boolean + val isRuntimeEditable: Boolean + + fun delete(settings: Settings): Boolean +} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt index 91b69b8fc3..faa551e0ab 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt @@ -6,13 +6,11 @@ class ScaledIntSetting( private val scale: Int, private val setting: AbstractIntSetting ) : AbstractIntSetting { - override fun isOverridden(): Boolean { - return setting.isOverridden() - } + override val isOverridden: Boolean + get() = setting.isOverridden - override fun isRuntimeEditable(): Boolean { - return setting.isRuntimeEditable - } + override val isRuntimeEditable: Boolean + get() = setting.isRuntimeEditable override fun delete(settings: Settings): Boolean { return setting.delete(settings)