From 63f6b70cc81ec9dc6e92b6521dfd78fa72fe70a5 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 27 Jul 2019 18:59:14 -0700 Subject: Fix compile errors --- .../src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt | 8 +++++--- about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt | 6 ++++-- about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'about/src/main/kotlin/ca/allanwang') 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>? + var items: List> /** * 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>? = null + override var items: List> = emptyList() override lateinit var adapter: FastItemThemedAdapter> @@ -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( +class CutoutIItem(val config: CutoutView.() -> Unit = {}) : KauIItem( 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) { 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( } } - override fun isSelectable(): Boolean = false + override var isSelectable: Boolean + get() = false + set(_) {} override fun bindView(holder: ViewHolder, payloads: MutableList) { super.bindView(holder, payloads) -- cgit v1.2.3