Rename function

This commit is contained in:
EdgarPi 2024-07-23 23:21:34 +02:00
parent 1328986cfe
commit 1bff9c4545

View file

@ -88,7 +88,7 @@ class SettingsUI : PreferenceFragmentCompat() {
getPref(R.string.app_theme_key)?.setOnPreferenceClickListener {
val prefNames = resources.getStringArray(R.array.themes_names).toMutableList()
val prefValues = resources.getStringArray(R.array.themes_names_values).toMutableList()
val removeFunction = { text: String ->
val removeIncompatible = { text: String ->
val toRemove = prefValues
.mapIndexed { idx, s -> if (s.startsWith(text)) idx else null }
.filterNotNull()
@ -100,10 +100,10 @@ class SettingsUI : PreferenceFragmentCompat() {
}
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { // remove monet on android 11 and less
removeFunction("Monet")
removeIncompatible("Monet")
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { // Remove system on android 9 and less
removeFunction("System")
removeIncompatible("System")
}
val currentLayout =