diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java deleted file mode 100644 index 834b10e077..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.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.AbstractFloatSetting; -import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; -import org.dolphinemu.dolphinemu.features.settings.model.Settings; - -public final class PercentSliderSetting extends FloatSliderSetting -{ - public PercentSliderSetting(Context context, AbstractFloatSetting setting, int titleId, - int descriptionId, int min, int max, String units, int stepSize) - { - super(context, setting, titleId, descriptionId, min, max, units, stepSize); - } - - @Override - public int getSelectedValue() - { - return Math.round(mSetting.getFloat() * 100); - } - - @Override - public void setSelectedValue(Settings settings, float selection) - { - mSetting.setFloat(settings, selection / 100); - } - - @Override - public AbstractSetting getSetting() - { - return mSetting; - } -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.kt new file mode 100644 index 0000000000..db6454b0c5 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.kt @@ -0,0 +1,27 @@ +// 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.AbstractFloatSetting +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting +import org.dolphinemu.dolphinemu.features.settings.model.Settings +import kotlin.math.roundToInt + +class PercentSliderSetting( + context: Context, + override val setting: AbstractFloatSetting, + titleId: Int, + descriptionId: Int, + min: Int, + max: Int, + units: String?, + stepSize: Int +) : FloatSliderSetting(context, setting, titleId, descriptionId, min, max, units, stepSize) { + override val selectedValue: Int + get() = (floatSetting.float * 100).roundToInt() + + override fun setSelectedValue(settings: Settings?, selection: Float) { + floatSetting.setFloat(settings!!, selection / 100) + } +}