fix url test not working after refreshing

This commit is contained in:
Kr328 committed 2019-12-08 23:47:35 +08:00
1 parent 24e1732091
commit f13abcbe49
1 file changed
+8 -4
@@ -142,7 +142,7 @@ class ProxyActivity : BaseActivity() {
.filterIsInstance<ListProxy.ListProxyHeader>()
.map { it.now }
val changed = if (listDataOldChanged.size != listDataChanged.size)
val changed = (if (listDataOldChanged.size != listDataChanged.size)
(0..listData.size).toList()
else {
listDataChanged.mapIndexed { index, i ->
@@ -150,8 +150,12 @@ class ProxyActivity : BaseActivity() {
emptyList()
else
listOf(listDataOldChanged[index], i)
}.flatten()
}
}.flatten() + listData.withIndex().filter {
it.value is ListProxy.ListProxyHeader
}.map {
it.index
}
}).toSet()
runOnUiThread {
activity_proxies_swipe.isRefreshing = false
@@ -159,7 +163,7 @@ class ProxyActivity : BaseActivity() {
(activity_proxies_list.adapter!! as ProxyAdapter).apply {
elements = listData
changed.toSet().forEach {
changed.forEach {
notifyItemChanged(it)
}
}