Android: Convert SliderSetting to Kotlin

This commit is contained in:
Charles Lombardo 2023-03-15 03:29:22 -04:00
parent 3c6bb9e0c9
commit 065c80fb4d
2 changed files with 47 additions and 61 deletions

View File

@ -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;
}
}

View File

@ -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
}