mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-03 12:12:50 +01:00
android: Fix cast for abstract settings
This commit is contained in:
parent
7531641ecc
commit
b6f57da70a
4 changed files with 5 additions and 5 deletions
|
@ -18,7 +18,7 @@ class DateTimeSetting(
|
||||||
|
|
||||||
val value: String
|
val value: String
|
||||||
get() = if (setting != null) {
|
get() = if (setting != null) {
|
||||||
val setting = setting as StringSetting
|
val setting = setting as AbstractStringSetting
|
||||||
setting.string
|
setting.string
|
||||||
} else {
|
} else {
|
||||||
defaultValue!!
|
defaultValue!!
|
||||||
|
|
|
@ -19,7 +19,7 @@ class SingleChoiceSetting(
|
||||||
|
|
||||||
val selectedValue: Int
|
val selectedValue: Int
|
||||||
get() = if (setting != null) {
|
get() = if (setting != null) {
|
||||||
val setting = setting as IntSetting
|
val setting = setting as AbstractIntSetting
|
||||||
setting.int
|
setting.int
|
||||||
} else {
|
} else {
|
||||||
defaultValue!!
|
defaultValue!!
|
||||||
|
|
|
@ -27,8 +27,8 @@ class SliderSetting(
|
||||||
get() {
|
get() {
|
||||||
val setting = setting ?: return defaultValue!!
|
val setting = setting ?: return defaultValue!!
|
||||||
return when (setting) {
|
return when (setting) {
|
||||||
is IntSetting -> setting.int
|
is AbstractIntSetting -> setting.int
|
||||||
is FloatSetting -> setting.float.roundToInt()
|
is AbstractFloatSetting -> setting.float.roundToInt()
|
||||||
else -> {
|
else -> {
|
||||||
Log.error("[SliderSetting] Error casting setting type.")
|
Log.error("[SliderSetting] Error casting setting type.")
|
||||||
-1
|
-1
|
||||||
|
|
|
@ -27,7 +27,7 @@ class StringSingleChoiceSetting(
|
||||||
|
|
||||||
val selectedValue: String
|
val selectedValue: String
|
||||||
get() = if (setting != null) {
|
get() = if (setting != null) {
|
||||||
val setting = setting as StringSetting
|
val setting = setting as AbstractStringSetting
|
||||||
setting.string
|
setting.string
|
||||||
} else {
|
} else {
|
||||||
defaultValue!!
|
defaultValue!!
|
||||||
|
|
Loading…
Reference in a new issue