aboutsummaryrefslogtreecommitdiff
path: root/adapter
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-22 16:08:08 -0700
committerGitHub <noreply@github.com>2017-07-22 16:08:08 -0700
commit61d87976e8b29ed25061ae98743a6cf4f4274542 (patch)
treefa4d9bca5fe1b9478ba2f1cc1e6c7d8d18bf15ce /adapter
parent8f2b5ac043f47cc44f43c3788d1377083fb339a2 (diff)
downloadkau-61d87976e8b29ed25061ae98743a6cf4f4274542.tar.gz
kau-61d87976e8b29ed25061ae98743a6cf4f4274542.tar.bz2
kau-61d87976e8b29ed25061ae98743a6cf4f4274542.zip
Support sdk 19 where possible and add image picker (#10)3.0
* 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
Diffstat (limited to 'adapter')
-rw-r--r--adapter/build.gradle6
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt4
-rw-r--r--adapter/src/main/res-public/values/public.xml4
3 files changed, 10 insertions, 4 deletions
diff --git a/adapter/build.gradle b/adapter/build.gradle
index bdeee97..772adca 100644
--- a/adapter/build.gradle
+++ b/adapter/build.gradle
@@ -1,8 +1,6 @@
-apply from: '../android-lib.gradle'
+ext.kauSubModuleMinSdk = project.CORE_MIN_SDK
-android {
- resourcePrefix "kau_"
-}
+apply from: '../android-lib.gradle'
dependencies {
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