aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'kpref-activity/src/main')
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt6
-rw-r--r--kpref-activity/src/main/res/layout/kau_pref_core.xml7
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"