aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-04-07 20:23:17 -0400
committerGitHub <noreply@github.com>2018-04-07 20:23:17 -0400
commita0377be622f21b4c6a7d8828505c1e95efab1254 (patch)
tree825760fab6f0bb1baa4e709443becefba5a8d06a /kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt
parente97db5c6529b1e12effc7141f277bd41d3fb580a (diff)
downloadkau-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/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt')
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt6
1 files changed, 3 insertions, 3 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 }