Simplify UpdateChannel
This commit is contained in:
parent
8bb2f356c0
commit
860a05abf2
@ -144,12 +144,12 @@ object UpdateChannel : BaseSettingsItem.Selector() {
|
||||
}
|
||||
|
||||
override val title = R.string.settings_update_channel_title.asTransitive()
|
||||
override val entries: Array<String> = resources.getStringArray(R.array.update_channel).let {
|
||||
if (BuildConfig.DEBUG) it.toMutableList().apply { add("Canary") }.toTypedArray() else it
|
||||
override val entries: Array<String> = resources.getStringArray(R.array.update_channel).apply {
|
||||
if (BuildConfig.VERSION_CODE % 100 == 0)
|
||||
toMutableList().apply { removeAt(Config.Value.CANARY_CHANNEL) }.toTypedArray()
|
||||
}
|
||||
override val description
|
||||
get() = entries.getOrNull(value)?.asTransitive()
|
||||
?: TransitiveText.String(if (value == -1) entries[0] else "Canary")
|
||||
get() = entries.getOrNull(value)?.asTransitive() ?: TransitiveText.String(entries[0])
|
||||
}
|
||||
|
||||
object UpdateChannelUrl : BaseSettingsItem.Input() {
|
||||
|
@ -73,6 +73,7 @@
|
||||
<item>@string/settings_update_stable</item>
|
||||
<item>@string/settings_update_beta</item>
|
||||
<item>@string/settings_update_custom</item>
|
||||
<item>Canary</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user