From cf4fdc6786cca7307f8ce15c3bcaba3d43c9f24e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 7 Jul 2017 15:01:04 -0700 Subject: Set progress text on bind --- core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefSeekbar.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'core/src/main/kotlin') diff --git a/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefSeekbar.kt b/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefSeekbar.kt index a6897a3..407018f 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefSeekbar.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefSeekbar.kt @@ -24,6 +24,7 @@ open class KPrefSeekbar(val builder: KPrefSeekbarContract) : KPrefItemBase( super.onPostBindView(viewHolder, textColor, accentColor) val text = viewHolder.bindInnerView(R.layout.kau_preference_seekbar_text) if (textColor != null) text.setTextColor(textColor) + val tvc = builder.textViewConfigs text.tvc() @@ -35,18 +36,16 @@ open class KPrefSeekbar(val builder: KPrefSeekbarContract) : KPrefItemBase( text.text = builder.toText(progress.fromProgress) } - override fun onStartTrackingTouch(sb: SeekBar) { - - } + override fun onStartTrackingTouch(sb: SeekBar) {} override fun onStopTrackingTouch(sb: SeekBar) { val trueProgress = sb.progress.fromProgress pref = trueProgress - KL.d("New pref $trueProgress") } }) } if (accentColor != null) seekbar.tint(accentColor) + text.text = builder.toText(seekbar.progress.fromProgress) //set initial text in case no change occurs seekbar.progress = pref.toProgress } -- cgit v1.2.3