aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-29 18:53:23 -0400
committerAllan Wang <me@allanwang.ca>2017-08-30 12:24:19 -0400
commit3adba8531753b0750303847948826819e7f09256 (patch)
treeaebee98cc984ad72a3852cd371bec39a4e17cd5b
parentfeefedf84268641198ee6ab742a000dd3220a471 (diff)
downloadkau-3adba8531753b0750303847948826819e7f09256.tar.gz
kau-3adba8531753b0750303847948826819e7f09256.tar.bz2
kau-3adba8531753b0750303847948826819e7f09256.zip
Only reload list if possible (#49)
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt2
1 files changed, 2 insertions, 0 deletions
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
index 4377631..2b75328 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
@@ -115,6 +115,8 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract {
* This will adjust the list of items change in visibility
*/
fun reloadList() {
+ // If for some reason we are calling a reload before fetching our first kpref list, we will ignore it
+ if (kprefStack.size < 1) return
recycler.itemAnimator = null
val list = kprefStack.peek().second
adapter.setNewList(list.filter { it.core.visible() })