diff options
Diffstat (limited to 'adapter/src')
-rw-r--r-- | adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt | 4 | ||||
-rw-r--r-- | adapter/src/main/res-public/values/public.xml | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt index 1349a35..b1c281a 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt @@ -1,6 +1,8 @@ package ca.allanwang.kau.adapters import android.content.res.ColorStateList +import android.os.Build +import android.support.annotation.RequiresApi import android.view.View import android.widget.ImageView import android.widget.TextView @@ -174,6 +176,7 @@ class ThemableIItemDelegate : ThemableIItem, ThemableIItemColors by ThemableIIte views.forEach { it?.setBackgroundColor(color) } } + @RequiresApi(Build.VERSION_CODES.LOLLIPOP) override fun bindBackgroundRipple(vararg views: View?) { val background = backgroundColor ?: return val foreground = accentColor ?: textColor ?: backgroundColor ?: return //default to normal background @@ -181,6 +184,7 @@ class ThemableIItemDelegate : ThemableIItem, ThemableIItemColors by ThemableIIte views.forEach { it?.background = ripple } } + @RequiresApi(Build.VERSION_CODES.LOLLIPOP) override fun bindIconColor(vararg views: ImageView?) { val color = accentColor ?: textColor ?: return views.forEach { it?.drawable?.setTintList(ColorStateList.valueOf(color)) } diff --git a/adapter/src/main/res-public/values/public.xml b/adapter/src/main/res-public/values/public.xml new file mode 100644 index 0000000..cf14680 --- /dev/null +++ b/adapter/src/main/res-public/values/public.xml @@ -0,0 +1,4 @@ +<resources xmlns:tools='http://schemas.android.com/tools' tools:ignore='ResourceName'> +<!-- AUTO-GENERATED FILE. DO NOT MODIFY. public.xml is generated by the generatepublicxml gradle task --> + <public name='dummy' type='id' /> +</resources>
\ No newline at end of file |