From fafc498df97891dca455cac19e41cc82a0ab53db Mon Sep 17 00:00:00 2001 From: LagradOst <11805592+LagradOst@users.noreply.github.com> Date: Mon, 18 Apr 2022 21:31:14 +0200 Subject: [PATCH] fixed pref quality --- .../ui/settings/SettingsFragment.kt | 8 +++++--- app/src/main/res/values/array.xml | 17 ----------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt index 90ca1acb..0876c974 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt @@ -47,8 +47,8 @@ import com.lagradost.cloudstream3.utils.InAppUpdater.Companion.runAutoUpdate import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog -import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showNginxTextInputDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showMultiDialog +import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showNginxTextInputDialog import com.lagradost.cloudstream3.utils.SubtitleHelper import com.lagradost.cloudstream3.utils.SubtitleHelper.getFlagFromIso import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe @@ -684,8 +684,10 @@ class SettingsFragment : PreferenceFragmentCompat() { } getPref(R.string.quality_pref_key)?.setOnPreferenceClickListener { - val prefNames = resources.getStringArray(R.array.quality_pref) - val prefValues = resources.getIntArray(R.array.quality_pref_values) + val prefValues = Qualities.values().map { it.value }.reversed().toMutableList() + prefValues.remove(Qualities.Unknown.value) + + val prefNames = prefValues.map { Qualities.getStringByInt(it) } val currentQuality = settingsManager.getInt( diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml index e7a11105..f139a8e4 100644 --- a/app/src/main/res/values/array.xml +++ b/app/src/main/res/values/array.xml @@ -14,23 +14,6 @@ @id/cast_button_type_forward_30_seconds - - 2160p - 1440p - 1080p - 720p - 480p - 360p - - - 4 - 3 - 2 - 1 - -1 - -2 - - @string/none Google