Merge remote-tracking branch 'origin/master'

This commit is contained in:
KillerDogeEmpire 2022-10-23 12:55:39 -07:00
commit abfde46d54
4 changed files with 16 additions and 16 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

@ -96,7 +96,7 @@ class SetupFragmentExtensions : Fragment() {
next_btt?.setOnClickListener {
// Continue setup
if (isSetup)
findNavController().navigate(R.id.action_navigation_setup_extensions_to_navigation_setup_media)
findNavController().navigate(R.id.action_navigation_setup_extensions_to_navigation_setup_provider_languages)
else
findNavController().navigate(R.id.navigation_home)
}

View File

@ -85,7 +85,7 @@ class SetupFragmentLanguage : Fragment() {
&& PluginManager.getPluginsLocal().isEmpty()
//&& PREBUILT_REPOSITORIES.isNotEmpty()
) R.id.action_navigation_global_to_navigation_setup_extensions
else R.id.action_navigation_setup_language_to_navigation_setup_media
else R.id.action_navigation_setup_language_to_navigation_setup_provider_languages
findNavController().navigate(
nextDestination,

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" />