This commit is contained in:
KillerDogeEmpire 2022-10-21 01:38:54 -07:00
parent 5cff88094d
commit bc54eea3ef
2 changed files with 14 additions and 14 deletions

View File

@ -199,20 +199,20 @@ object APIHolder {
* but it turned out too complicated and unnecessary with extensions.
**/
fun Context.getApiProviderLangSettings(): HashSet<String> {
val langs = apis.map { it.lang }.toSet()
.sortedBy { SubtitleHelper.fromTwoLettersToLanguage(it) }
return langs.toHashSet()
//val langs = apis.map { it.lang }.toSet()
//.sortedBy { SubtitleHelper.fromTwoLettersToLanguage(it) }
//return langs.toHashSet()
// val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
// val hashSet = HashSet<String>()
// hashSet.add("en") // def is only en
// val list = settingsManager.getStringSet(
// this.getString(R.string.provider_lang_key),
// hashSet.toMutableSet()
// )
//
// if (list.isNullOrEmpty()) return hashSet
// return list.toHashSet()
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
val hashSet = HashSet<String>()
hashSet.add("en") // def is only en
val list = settingsManager.getStringSet(
this.getString(R.string.provider_lang_key),
hashSet.toMutableSet()
)
if (list.isNullOrEmpty()) return hashSet
return list.toHashSet()
}
fun Context.getApiTypeSettings(): HashSet<TvType> {

View File

@ -2,7 +2,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Preference
app:isPreferenceVisible="false"
app:isPreferenceVisible="true"
android:icon="@drawable/ic_baseline_language_24"
android:key="@string/provider_lang_key"
android:title="@string/provider_lang_settings" />