diff options
author | Allan Wang <me@allanwang.ca> | 2019-06-13 01:14:21 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-06-13 01:14:21 -0700 |
commit | 01058912580a3ecfe77eaf6af209e1c46a97f2d7 (patch) | |
tree | 912e9cf5cd089a444d5cda0a032f933f2aa93918 /about/src | |
parent | 423cad016753a795e9cb75534d172f562e4326c1 (diff) | |
download | kau-01058912580a3ecfe77eaf6af209e1c46a97f2d7.tar.gz kau-01058912580a3ecfe77eaf6af209e1c46a97f2d7.tar.bz2 kau-01058912580a3ecfe77eaf6af209e1c46a97f2d7.zip |
Initial fastadapter update
Diffstat (limited to 'about/src')
4 files changed, 9 insertions, 9 deletions
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt index 79077c5..cc0eb91 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -128,7 +128,7 @@ abstract class AboutActivityBase(val rClass: Class<*>?, private val configBuilde * Open hook called just before the main page view is returned * Feel free to add your own items to the adapter in here */ - open fun postInflateMainPage(adapter: FastItemThemedAdapter<IItem<*, *>>) { + open fun postInflateMainPage(adapter: FastItemThemedAdapter<IItem<*>>) { } /** 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 924a771..814fd64 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt @@ -48,11 +48,11 @@ 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 */ - var adapter: FastItemThemedAdapter<IItem<*, *>> + var adapter: FastItemThemedAdapter<IItem<*>> /** * Reference to the recyclerview, will be used to stop scrolling upon exit */ @@ -90,9 +90,9 @@ interface AboutPanelContract { abstract class AboutPanelRecycler : AboutPanelContract { - override var items: List<IItem<*, *>>? = null + override var items: List<IItem<*>>? = null - override lateinit var adapter: FastItemThemedAdapter<IItem<*, *>> + override lateinit var adapter: FastItemThemedAdapter<IItem<*>> override var recycler: RecyclerView? = null diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt index 755ac81..8ae445d 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt @@ -41,14 +41,14 @@ class FaqIItem(val content: FaqItem) : KauIItem<LibraryIItem, FaqIItem.ViewHolde ), ThemableIItem by ThemableIItemDelegate() { companion object { - fun bindEvents(fastAdapter: FastAdapter<IItem<*, *>>) { + fun bindEvents(fastAdapter: FastAdapter<IItem<*>>) { fastAdapter.withSelectable(false) - .withEventHook(object : ClickEventHook<IItem<*, *>>() { + .withEventHook(object : ClickEventHook<IItem<*>>() { override fun onBind(viewHolder: RecyclerView.ViewHolder): View? = (viewHolder as? ViewHolder)?.questionContainer - override fun onClick(v: View, position: Int, adapter: FastAdapter<IItem<*, *>>, item: IItem<*, *>) { + override fun onClick(v: View, position: Int, adapter: FastAdapter<IItem<*>>, item: IItem<*>) { if (item !is FaqIItem) return item.isExpanded = !item.isExpanded v.parentViewGroup.findViewById<CollapsibleTextView>(R.id.faq_item_answer) 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 33aac09..dbff49a 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt @@ -39,7 +39,7 @@ class LibraryIItem(val lib: Library) : KauIItem<LibraryIItem, LibraryIItem.ViewH ), ThemableIItem by ThemableIItemDelegate() { companion object { - fun bindEvents(fastAdapter: FastAdapter<IItem<*, *>>) { + fun bindEvents(fastAdapter: FastAdapter<IItem<*>>) { fastAdapter.withSelectable(false) .withOnClickListener { v, _, item, _ -> if (item !is LibraryIItem) |