From a8cfc17caabc7ae28b68e246e9131ad3cd6c7311 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 28 Aug 2019 15:34:52 +0800 Subject: [PATCH] up --- .../app/ui/readbook/config/ReadStyleDialog.kt | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt index 638e6c3fe..1841b6df1 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt @@ -87,11 +87,13 @@ class ReadStyleDialog : DialogFragment() { } seek_text_size.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { - textSize = progress + 5 - postEvent(Bus.UP_CONFIG, true) + } override fun onStartTrackingTouch(seekBar: SeekBar?) {} - override fun onStopTrackingTouch(seekBar: SeekBar?) {} + override fun onStopTrackingTouch(seekBar: SeekBar?) { + textSize = seek_text_size.progress + 5 + postEvent(Bus.UP_CONFIG, true) + } }) iv_text_size_add.onClick { textSize++ @@ -108,12 +110,14 @@ class ReadStyleDialog : DialogFragment() { seek_text_letter_spacing.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { - letterSpacing = (progress - 5) / 10f - postEvent(Bus.UP_CONFIG, true) + } override fun onStartTrackingTouch(seekBar: SeekBar?) {} - override fun onStopTrackingTouch(seekBar: SeekBar?) {} + override fun onStopTrackingTouch(seekBar: SeekBar?) { + letterSpacing = (seek_text_letter_spacing.progress - 5) / 10f + postEvent(Bus.UP_CONFIG, true) + } }) iv_text_letter_spacing_add.onClick { letterSpacing += 0.1f @@ -128,12 +132,14 @@ class ReadStyleDialog : DialogFragment() { seek_line_size.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { - lineSpacingExtra = progress.toFloat() - postEvent(Bus.UP_CONFIG, true) + } override fun onStartTrackingTouch(seekBar: SeekBar?) {} - override fun onStopTrackingTouch(seekBar: SeekBar?) {} + override fun onStopTrackingTouch(seekBar: SeekBar?) { + lineSpacingExtra = seek_line_size.progress.toFloat() + postEvent(Bus.UP_CONFIG, true) + } }) iv_line_size_add.onClick { lineSpacingExtra++