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 | |
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')
3 files changed, 12 insertions, 6 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) } } diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt index b51c9c8..d51db46 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt @@ -27,11 +27,13 @@ import ca.allanwang.kau.ui.views.CutoutView * * Just a cutout item with some defaults in [R.layout.kau_iitem_cutout] */ -class CutoutIItem(val config: CutoutView.() -> Unit = {}) : KauIItem<CutoutIItem, CutoutIItem.ViewHolder>( +class CutoutIItem(val config: CutoutView.() -> Unit = {}) : KauIItem<CutoutIItem.ViewHolder>( R.layout.kau_iitem_cutout, ::ViewHolder, R.id.kau_item_cutout ), ThemableIItem by ThemableIItemDelegate() { - override fun isSelectable(): Boolean = false + override var isSelectable: Boolean + get() = false + set(_) {} override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) { super.bindView(holder, payloads) diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt index 445d435..dcc0874 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt @@ -54,7 +54,9 @@ class LibraryIItem(val lib: Library) : KauIItem<LibraryIItem.ViewHolder>( } } - override fun isSelectable(): Boolean = false + override var isSelectable: Boolean + get() = false + set(_) {} override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) { super.bindView(holder, payloads) |