diff options
author | Allan Wang <allanwang@google.com> | 2019-07-27 18:59:14 -0700 |
---|---|---|
committer | Allan Wang <allanwang@google.com> | 2019-07-27 18:59:14 -0700 |
commit | 63f6b70cc81ec9dc6e92b6521dfd78fa72fe70a5 (patch) | |
tree | a7fdc9cd1ec78a6bd43c80fec33896a3d427d2b6 /about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt | |
parent | 99f1e76a4d8d35d4d3ca1aadf68bbc227a70ba01 (diff) | |
download | kau-63f6b70cc81ec9dc6e92b6521dfd78fa72fe70a5.tar.gz kau-63f6b70cc81ec9dc6e92b6521dfd78fa72fe70a5.tar.bz2 kau-63f6b70cc81ec9dc6e92b6521dfd78fa72fe70a5.zip |
Fix compile errors
Diffstat (limited to 'about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt')
-rw-r--r-- | about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt index aae6cb0..512516d 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt @@ -48,7 +48,7 @@ interface AboutPanelContract { /** * Model list to be added to [adapter] */ - var items: List<IItem<*>>? + var items: List<IItem<*>> /** * The adapter, will be late initialized as it depends on configs */ @@ -90,7 +90,7 @@ interface AboutPanelContract { abstract class AboutPanelRecycler : AboutPanelContract { - override var items: List<IItem<*>>? = null + override var items: List<IItem<*>> = emptyList() override lateinit var adapter: FastItemThemedAdapter<IItem<*>> @@ -116,7 +116,9 @@ abstract class AboutPanelRecycler : AboutPanelContract { } override fun addItems(activity: AboutActivityBase, position: Int) { - if (items == null) return + if (items.isEmpty()) { + return + } activity.pageStatus[position] = 2 postDelayed(300) { addItemsImpl(activity, position) } } |