diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-07 15:01:04 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-07-07 15:01:04 -0700 |
commit | cf4fdc6786cca7307f8ce15c3bcaba3d43c9f24e (patch) | |
tree | f7c078415d0999844e388e78cee36dbe0be0922f /core/src/main | |
parent | e0a74eff3175a701fe306bcb3a5f9a713c79d8c8 (diff) | |
download | kau-cf4fdc6786cca7307f8ce15c3bcaba3d43c9f24e.tar.gz kau-cf4fdc6786cca7307f8ce15c3bcaba3d43c9f24e.tar.bz2 kau-cf4fdc6786cca7307f8ce15c3bcaba3d43c9f24e.zip |
Set progress text on bind
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefSeekbar.kt | 7 |
1 files changed, 3 insertions, 4 deletions
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<Int>( super.onPostBindView(viewHolder, textColor, accentColor) val text = viewHolder.bindInnerView<TextView>(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<Int>( 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 } |