mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
Android: Convert SliderSetting to Kotlin
This commit is contained in:
parent
3c6bb9e0c9
commit
065c80fb4d
@ -1,61 +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.Settings;
|
||||
|
||||
public abstract class SliderSetting extends SettingsItem
|
||||
{
|
||||
private int mMin;
|
||||
private int mMax;
|
||||
private String mUnits;
|
||||
private int mStepSize;
|
||||
|
||||
public SliderSetting(Context context, int nameId, int descriptionId, int min, int max,
|
||||
String units, int stepSize)
|
||||
{
|
||||
super(context, nameId, descriptionId);
|
||||
mMin = min;
|
||||
mMax = max;
|
||||
mUnits = units;
|
||||
mStepSize = stepSize;
|
||||
}
|
||||
|
||||
public SliderSetting(CharSequence name, CharSequence description, int min, int max, String units)
|
||||
{
|
||||
super(name, description);
|
||||
mMin = min;
|
||||
mMax = max;
|
||||
mUnits = units;
|
||||
}
|
||||
|
||||
public abstract int getSelectedValue();
|
||||
|
||||
public int getMin()
|
||||
{
|
||||
return mMin;
|
||||
}
|
||||
|
||||
public int getMax()
|
||||
{
|
||||
return mMax;
|
||||
}
|
||||
|
||||
public String getUnits()
|
||||
{
|
||||
return mUnits;
|
||||
}
|
||||
|
||||
public int getStepSize()
|
||||
{
|
||||
return mStepSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType()
|
||||
{
|
||||
return TYPE_SLIDER;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view
|
||||
|
||||
import android.content.Context
|
||||
|
||||
abstract class SliderSetting : SettingsItem {
|
||||
override val type: Int = TYPE_SLIDER
|
||||
|
||||
var min: Int
|
||||
private set
|
||||
var max: Int
|
||||
private set
|
||||
var units: String?
|
||||
private set
|
||||
var stepSize = 0
|
||||
private set
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
nameId: Int,
|
||||
descriptionId: Int,
|
||||
min: Int,
|
||||
max: Int,
|
||||
units: String?,
|
||||
stepSize: Int
|
||||
) : super(context, nameId, descriptionId) {
|
||||
this.min = min
|
||||
this.max = max
|
||||
this.units = units
|
||||
this.stepSize = stepSize
|
||||
}
|
||||
|
||||
constructor(
|
||||
name: CharSequence,
|
||||
description: CharSequence?,
|
||||
min: Int,
|
||||
max: Int,
|
||||
units: String?
|
||||
) : super(name, description) {
|
||||
this.min = min
|
||||
this.max = max
|
||||
this.units = units
|
||||
}
|
||||
|
||||
abstract val selectedValue: Int
|
||||
}
|
Loading…
Reference in New Issue
Block a user