Android: Convert IntSliderSetting to Kotlin

This commit is contained in:
Charles Lombardo 2023-03-15 03:27:27 -04:00
parent 826e849a7b
commit 2369977e14
2 changed files with 29 additions and 37 deletions

View File

@ -1,37 +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.AbstractIntSetting;
import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting;
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
public final class IntSliderSetting extends SliderSetting
{
private AbstractIntSetting mSetting;
public IntSliderSetting(Context context, AbstractIntSetting setting, int titleId,
int descriptionId, int min, int max, String units, int stepSize)
{
super(context, titleId, descriptionId, min, max, units, stepSize);
mSetting = setting;
}
public int getSelectedValue()
{
return mSetting.getInt();
}
public void setSelectedValue(Settings settings, int selection)
{
mSetting.setInt(settings, selection);
}
@Override
public AbstractSetting getSetting()
{
return mSetting;
}
}

View File

@ -0,0 +1,29 @@
// 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.AbstractIntSetting
import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting
import org.dolphinemu.dolphinemu.features.settings.model.Settings
class IntSliderSetting(
context: Context,
private val intSetting: AbstractIntSetting,
titleId: Int,
descriptionId: Int,
min: Int,
max: Int,
units: String?,
stepSize: Int
) : SliderSetting(context, titleId, descriptionId, min, max, units, stepSize) {
override val setting: AbstractSetting
get() = intSetting
override val selectedValue: Int
get() = intSetting.int
fun setSelectedValue(settings: Settings?, selection: Int) {
intSetting.setInt(settings!!, selection)
}
}