diff options
Diffstat (limited to 'adapter/src/main/kotlin/ca/allanwang')
-rw-r--r-- | adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt | 4 |
1 files changed, 4 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)) } |