mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 07:49:19 +01:00
Android: Convert IntSliderSetting to Kotlin
This commit is contained in:
parent
826e849a7b
commit
2369977e14
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user