aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-23 13:13:36 -0700
committerGitHub <noreply@github.com>2017-07-23 13:13:36 -0700
commit4706b8f6a8d08a6961da6ab34d15881b63356d79 (patch)
tree3d1e611e43bd589a98a5f1840c5b6f52ff254468 /kpref-activity/src/main/kotlin/ca/allanwang
parent61d87976e8b29ed25061ae98743a6cf4f4274542 (diff)
downloadkau-4706b8f6a8d08a6961da6ab34d15881b63356d79.tar.gz
kau-4706b8f6a8d08a6961da6ab34d15881b63356d79.tar.bz2
kau-4706b8f6a8d08a6961da6ab34d15881b63356d79.zip
Update kpref-activity's min-sdk and other minor changes (#11)3.1.0
* Move some resources to public * Lower kpref minsdk * Remove excess kauUtils annotations * Allow nullable throwable * Do not throw null throwable * Make image picker base abstract again * Migrate about strings to private * Update readme * Update readme * Update sample tagging * Update adapter readme
Diffstat (limited to 'kpref-activity/src/main/kotlin/ca/allanwang')
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt2
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt3
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt4
3 files changed, 7 insertions, 2 deletions
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
index b978a6e..91c0cf2 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt
@@ -1,5 +1,6 @@
package ca.allanwang.kau.kpref.activity
+import android.annotation.SuppressLint
import android.os.Bundle
import android.support.annotation.StringRes
import android.support.constraint.ConstraintLayout
@@ -51,6 +52,7 @@ abstract class KPrefActivity : AppCompatActivity(), KPrefActivityContract {
*/
abstract fun kPrefCoreAttributes(): CoreAttributeContract.() -> Unit
+ @SuppressLint("NewApi")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//setup layout
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt
index 19bdb56..5738022 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt
@@ -1,5 +1,6 @@
package ca.allanwang.kau.kpref.activity.items
+import android.support.v7.widget.AppCompatCheckBox
import android.view.View
import android.widget.CheckBox
import ca.allanwang.kau.kpref.activity.R
@@ -15,7 +16,7 @@ open class KPrefCheckbox(builder: BaseContract<Boolean>) : KPrefItemBase<Boolean
override fun defaultOnClick(itemView: View, innerContent: View?): Boolean {
pref = !pref
- (innerContent as CheckBox).isChecked = pref
+ (innerContent as AppCompatCheckBox).isChecked = pref
return true
}
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt
index 908c139..bd245af 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt
@@ -1,5 +1,6 @@
package ca.allanwang.kau.kpref.activity.items
+import android.annotation.SuppressLint
import android.support.annotation.CallSuper
import android.support.annotation.IdRes
import android.support.annotation.LayoutRes
@@ -31,6 +32,7 @@ abstract class KPrefItemCore(val core: CoreContract) : AbstractItem<KPrefItemCor
override final fun getViewHolder(v: View) = ViewHolder(v)
+ @SuppressLint("NewApi")
@CallSuper
override fun bindView(viewHolder: ViewHolder, payloads: List<Any>) {
super.bindView(viewHolder, payloads)
@@ -50,7 +52,7 @@ abstract class KPrefItemCore(val core: CoreContract) : AbstractItem<KPrefItemCor
desc?.setTextColor(textColor)
}
val accentColor = core.globalOptions.accentColor?.invoke()
- if (accentColor != null) {
+ if (accentColor != null && buildIsLollipopAndUp) {
icon?.drawable?.setTint(accentColor)
}
onPostBindView(this, textColor, accentColor)