diff --git a/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt index 89f391d62..92ef4b7cc 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt @@ -1,9 +1,11 @@ package com.github.libretube.ui.preferences +import android.os.Build import android.os.Bundle import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat +import com.github.libretube.BuildConfig import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.ui.adapters.IconsSheetAdapter @@ -78,16 +80,17 @@ class AppearanceSettings : BasePreferenceFragment() { } } - // remove material you from accent color option if not available + /** + * Remove material you from accent color option if not available + */ private fun updateAccentColorValues(pref: ListPreference) { - val dynamicColorsAvailable = DynamicColors.isDynamicColorAvailable() - if (!dynamicColorsAvailable) { - val entries = pref.entries.toMutableList() - entries -= entries[0] - pref.entries = entries.toTypedArray() - val values = pref.entryValues.toMutableList() - values -= values[0] - pref.entryValues = values.toTypedArray() + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { + pref.entries = pref.entries.toMutableList().apply { + removeFirst() + }.toTypedArray() + pref.entryValues = pref.entryValues.toMutableList().apply { + removeFirst() + }.toTypedArray() } } }