Skip to content

Commit 0fd0481

Browse files
Merge remote-tracking branch 'upstream/master'
# Conflicts: # app/build.gradle
2 parents 10ba102 + 99fa40e commit 0fd0481

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,8 @@ class HomeFragment : Fragment() {
232232
currentValidApis.addAll(0, validAPIs.subList(0, 2))
233233

234234
val names = currentValidApis.map { if(isMultiLang) "${getFlagFromIso(it.lang)?.plus(" ") ?: ""}${it.name}" else it.name }
235-
val index = names.indexOf(currentApiName)
235+
val index = currentValidApis.map { it.name }.indexOf(currentApiName)
236236
listView?.setItemChecked(index, true)
237-
arrayAdapter.notifyDataSetChanged()
238237
arrayAdapter.addAll(names)
239238
arrayAdapter.notifyDataSetChanged()
240239
}

app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ class SearchFragment : Fragment() {
231231
it.lang
232232
)?.plus(" ") ?: ""
233233
}${it.name}" else it.name }
234-
235-
for ((index, api) in names.withIndex()) {
234+
for ((index, api) in currentValidApis.map { it.name }.withIndex()) {
236235
listView?.setItemChecked(index, currentSelectedApis.contains(api))
237236
}
238237

0 commit comments

Comments
 (0)