diff options
author | Allan Wang <allanwang@google.com> | 2019-07-27 19:45:00 -0700 |
---|---|---|
committer | Allan Wang <allanwang@google.com> | 2019-07-27 19:45:00 -0700 |
commit | df1f578cdffb5314bde26c7ffbedc6b1a1d96692 (patch) | |
tree | 1c909c04400e4d09d5fc74d34a32d2f5415f266b /fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt | |
parent | 6a599e553a467f15be7ed60c554f43aeac5936ca (diff) | |
download | kau-df1f578cdffb5314bde26c7ffbedc6b1a1d96692.tar.gz kau-df1f578cdffb5314bde26c7ffbedc6b1a1d96692.tar.bz2 kau-df1f578cdffb5314bde26c7ffbedc6b1a1d96692.zip |
Us genericitem where applicable
Diffstat (limited to 'fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt')
-rw-r--r-- | fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt index 24a37c4..e3f43ca 100644 --- a/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt @@ -23,6 +23,7 @@ import android.widget.TextView import androidx.annotation.RequiresApi import ca.allanwang.kau.ui.createSimpleRippleDrawable import ca.allanwang.kau.utils.adjustAlpha +import com.mikepenz.fastadapter.GenericItem import com.mikepenz.fastadapter.IItem import com.mikepenz.fastadapter.IItemAdapter import com.mikepenz.fastadapter.adapters.FastItemAdapter @@ -36,7 +37,7 @@ import com.mikepenz.fastadapter.adapters.FastItemAdapter * This adapter overrides every method where an item is added * If that item extends [ThemableIItem], then the colors will be set */ -class FastItemThemedAdapter<Item : IItem<*>>( +class FastItemThemedAdapter<Item : GenericItem>( textColor: Int? = null, backgroundColor: Int? = null, accentColor: Int? = null @@ -85,11 +86,11 @@ class FastItemThemedAdapter<Item : IItem<*>>( notifyAdapterDataSetChanged() } - private fun injectTheme(items: Collection<IItem<*>?>?) { + private fun injectTheme(items: Collection<GenericItem?>?) { items?.forEach { injectTheme(it) } } - protected fun injectTheme(item: IItem<*>?) { + protected fun injectTheme(item: GenericItem?) { if (item is ThemableIItem && item.themeEnabled) { item.textColor = textColor item.backgroundColor = backgroundColor |