mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 20:15:29 +00:00
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 title = R.string.settings_update_channel_title.asTransitive()
|
||||||
override val entries: Array<String> = resources.getStringArray(R.array.update_channel).let {
|
override val entries: Array<String> = resources.getStringArray(R.array.update_channel).apply {
|
||||||
if (BuildConfig.DEBUG) it.toMutableList().apply { add("Canary") }.toTypedArray() else it
|
if (BuildConfig.VERSION_CODE % 100 == 0)
|
||||||
|
toMutableList().apply { removeAt(Config.Value.CANARY_CHANNEL) }.toTypedArray()
|
||||||
}
|
}
|
||||||
override val description
|
override val description
|
||||||
get() = entries.getOrNull(value)?.asTransitive()
|
get() = entries.getOrNull(value)?.asTransitive() ?: TransitiveText.String(entries[0])
|
||||||
?: TransitiveText.String(if (value == -1) entries[0] else "Canary")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object UpdateChannelUrl : BaseSettingsItem.Input() {
|
object UpdateChannelUrl : BaseSettingsItem.Input() {
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
<item>@string/settings_update_stable</item>
|
<item>@string/settings_update_stable</item>
|
||||||
<item>@string/settings_update_beta</item>
|
<item>@string/settings_update_beta</item>
|
||||||
<item>@string/settings_update_custom</item>
|
<item>@string/settings_update_custom</item>
|
||||||
|
<item>Canary</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user