diff options
author | Allan Wang <me@allanwang.ca> | 2018-04-07 20:23:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-07 20:23:17 -0400 |
commit | a0377be622f21b4c6a7d8828505c1e95efab1254 (patch) | |
tree | 825760fab6f0bb1baa4e709443becefba5a8d06a /kpref-activity | |
parent | e97db5c6529b1e12effc7141f277bd41d3fb580a (diff) | |
download | kau-a0377be622f21b4c6a7d8828505c1e95efab1254.tar.gz kau-a0377be622f21b4c6a7d8828505c1e95efab1254.tar.bz2 kau-a0377be622f21b4c6a7d8828505c1e95efab1254.zip |
Update/android studio 3.1 (#146)
* Update dependencies
* Add default invalid id value
* Extend appcompat views only
* Update migration
* Remove setTextIfValid
* Remove nosibling warning
* Add deprecation warnings to fragment view binding
* Bring back glide 4.6.1
* Use proper distribution type setter
Diffstat (limited to 'kpref-activity')
-rw-r--r-- | kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt | 6 | ||||
-rw-r--r-- | kpref-activity/src/main/res/layout/kau_pref_core.xml | 7 |
2 files changed, 7 insertions, 6 deletions
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 992dd28..2491d01 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 @@ -34,7 +34,7 @@ abstract class KPrefItemCore(val core: CoreContract) : AbstractItem<KPrefItemCor protected fun ViewHolder.updateDesc() { val descRes = core.descFun() - if (descRes > 0) + if (descRes != INVALID_ID) desc?.visible()?.setText(descRes) else desc?.gone() @@ -118,12 +118,12 @@ abstract class KPrefItemCore(val core: CoreContract) : AbstractItem<KPrefItemCor */ class CoreBuilder(override val globalOptions: GlobalOptions, override val titleId: Int) : CoreContract { - override var descRes: Int = -1 + override var descRes: Int = INVALID_ID set(value) { field = value descFun = { field } } - override var descFun = { -1 } + override var descFun = { INVALID_ID } override var iicon: IIcon? = null override var visible = { true } override var titleFun = { titleId } diff --git a/kpref-activity/src/main/res/layout/kau_pref_core.xml b/kpref-activity/src/main/res/layout/kau_pref_core.xml index 498dce3..72f26d9 100644 --- a/kpref-activity/src/main/res/layout/kau_pref_core.xml +++ b/kpref-activity/src/main/res/layout/kau_pref_core.xml @@ -34,8 +34,8 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.5" - tools:layout_editor_absoluteX="0dp" - tools:ignore="RtlSymmetry" /> + tools:ignore="RtlSymmetry" + tools:layout_editor_absoluteX="0dp" /> <android.support.v7.widget.AppCompatTextView android:id="@id/kau_pref_title" @@ -87,7 +87,8 @@ app:barrierDirection="end" app:constraint_referenced_ids="kau_pref_title,kau_pref_desc" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + tools:ignore="NotSibling" /> <LinearLayout android:id="@id/kau_pref_inner_frame" |