diff --git a/app/build.gradle b/app/build.gradle index 8be4709c..375b019f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,7 +36,7 @@ android { targetSdkVersion 30 versionCode 45 - versionName "2.9.16" + versionName "2.9.17" resValue "string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}" diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt index da214a20..c97c384b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt @@ -229,9 +229,8 @@ class HomeFragment : Fragment() { currentValidApis.addAll(0, validAPIs.subList(0, 2)) val names = currentValidApis.map { if(isMultiLang) "${getFlagFromIso(it.lang)?.plus(" ") ?: ""}${it.name}" else it.name } - val index = names.indexOf(currentApiName) + val index = currentValidApis.map { it.name }.indexOf(currentApiName) listView?.setItemChecked(index, true) - arrayAdapter.notifyDataSetChanged() arrayAdapter.addAll(names) arrayAdapter.notifyDataSetChanged() } diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt index 3184f2ed..289c2904 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt @@ -230,8 +230,7 @@ class SearchFragment : Fragment() { it.lang )?.plus(" ") ?: "" }${it.name}" else it.name } - - for ((index, api) in names.withIndex()) { + for ((index, api) in currentValidApis.map { it.name }.withIndex()) { listView?.setItemChecked(index, currentSelectedApis.contains(api)) }