File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
app/src/main/java/com/lagradost/cloudstream3/ui Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments