From 61d87976e8b29ed25061ae98743a6cf4f4274542 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 22 Jul 2017 16:08:08 -0700 Subject: Support sdk 19 where possible and add image picker (#10) * Fix plural * Switch to long * Test plural again * Comment * Major update to image picker and view utils * Make image activity full screen * Update min sdk and prefix * Lower sdk requirement and make string private * Bring kpref activity to sdk 19 --- .../main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt | 4 ++++ adapter/src/main/res-public/values/public.xml | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 adapter/src/main/res-public/values/public.xml (limited to 'adapter/src/main') 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 @@ + + + + \ No newline at end of file -- cgit v1.2.3