aboutsummaryrefslogtreecommitdiff
path: root/about/src
diff options
context:
space:
mode:
authorAllan Wang <allanwang@google.com>2019-07-27 19:45:00 -0700
committerAllan Wang <allanwang@google.com>2019-07-27 19:45:00 -0700
commitdf1f578cdffb5314bde26c7ffbedc6b1a1d96692 (patch)
tree1c909c04400e4d09d5fc74d34a32d2f5415f266b /about/src
parent6a599e553a467f15be7ed60c554f43aeac5936ca (diff)
downloadkau-df1f578cdffb5314bde26c7ffbedc6b1a1d96692.tar.gz
kau-df1f578cdffb5314bde26c7ffbedc6b1a1d96692.tar.bz2
kau-df1f578cdffb5314bde26c7ffbedc6b1a1d96692.zip
Us genericitem where applicable
Diffstat (limited to 'about/src')
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt3
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt9
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt9
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt3
4 files changed, 14 insertions, 10 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 cc0eb91..d346090 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt
@@ -33,6 +33,7 @@ import ca.allanwang.kau.utils.INVALID_ID
import ca.allanwang.kau.utils.dimenPixelSize
import com.mikepenz.aboutlibraries.Libs
import com.mikepenz.aboutlibraries.entity.Library
+import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IItem
import kotlinx.android.synthetic.main.kau_activity_about.*
@@ -128,7 +129,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<GenericItem>) {
}
/**
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 512516d..24f1c48 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt
@@ -34,6 +34,7 @@ import ca.allanwang.kau.utils.string
import ca.allanwang.kau.utils.withMarginDecoration
import ca.allanwang.kau.xml.kauParseFaq
import com.mikepenz.aboutlibraries.Libs
+import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IItem
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -48,11 +49,11 @@ interface AboutPanelContract {
/**
* Model list to be added to [adapter]
*/
- var items: List<IItem<*>>
+ var items: List<GenericItem>
/**
* The adapter, will be late initialized as it depends on configs
*/
- var adapter: FastItemThemedAdapter<IItem<*>>
+ var adapter: FastItemThemedAdapter<GenericItem>
/**
* Reference to the recyclerview, will be used to stop scrolling upon exit
*/
@@ -90,9 +91,9 @@ interface AboutPanelContract {
abstract class AboutPanelRecycler : AboutPanelContract {
- override var items: List<IItem<*>> = emptyList()
+ override var items: List<GenericItem> = emptyList()
- override lateinit var adapter: FastItemThemedAdapter<IItem<*>>
+ override lateinit var adapter: FastItemThemedAdapter<GenericItem>
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 96b9884..0a570f8 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt
@@ -30,6 +30,7 @@ import ca.allanwang.kau.utils.parentViewGroup
import ca.allanwang.kau.utils.setPaddingLeft
import ca.allanwang.kau.xml.FaqItem
import com.mikepenz.fastadapter.FastAdapter
+import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.listeners.ClickEventHook
import com.mikepenz.fastadapter.select.getSelectExtension
@@ -42,9 +43,9 @@ class FaqIItem(val content: FaqItem) : KauIItem<FaqIItem.ViewHolder>(
), ThemableIItem by ThemableIItemDelegate() {
companion object {
- fun bindEvents(fastAdapter: FastAdapter<IItem<*>>) {
+ fun bindEvents(fastAdapter: FastAdapter<GenericItem>) {
fastAdapter.getSelectExtension().isSelectable = true
- fastAdapter.addEventHook(object : ClickEventHook<IItem<*>>() {
+ fastAdapter.addEventHook(object : ClickEventHook<GenericItem>() {
override fun onBind(viewHolder: RecyclerView.ViewHolder): View? =
(viewHolder as? ViewHolder)?.questionContainer
@@ -52,8 +53,8 @@ class FaqIItem(val content: FaqItem) : KauIItem<FaqIItem.ViewHolder>(
override fun onClick(
v: View,
position: Int,
- fastAdapter: FastAdapter<IItem<*>>,
- item: IItem<*>
+ fastAdapter: FastAdapter<GenericItem>,
+ item: GenericItem
) {
if (item !is FaqIItem) return
item.isExpanded = !item.isExpanded
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 dcc0874..8f93422 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
@@ -29,6 +29,7 @@ import ca.allanwang.kau.utils.startLink
import ca.allanwang.kau.utils.visible
import com.mikepenz.aboutlibraries.entity.Library
import com.mikepenz.fastadapter.FastAdapter
+import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.select.getSelectExtension
@@ -40,7 +41,7 @@ class LibraryIItem(val lib: Library) : KauIItem<LibraryIItem.ViewHolder>(
), ThemableIItem by ThemableIItemDelegate() {
companion object {
- fun bindEvents(fastAdapter: FastAdapter<IItem<*>>) {
+ fun bindEvents(fastAdapter: FastAdapter<GenericItem>) {
fastAdapter.getSelectExtension().isSelectable = true
fastAdapter.onClickListener = { v, _, item, _ ->
if (item !is LibraryIItem)