diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index 989cdad40..6bd81c895 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt @@ -462,6 +462,8 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea page_view.upStyle() if (it) { loadContent() + } else { + page_view.upContent() } } observeEvent(Bus.TTS_START) { chapterStart -> 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 ff4e6d116..1ac15d2cb 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 @@ -83,29 +83,46 @@ class ReadStyleDialog : DialogFragment() { tv_text_bold.onClick { textBold = !textBold tv_text_bold.isSelected = textBold - postEvent(Bus.UP_CONFIG, true) + postEvent(Bus.UP_CONFIG, false) } 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?) {} }) iv_text_size_add.onClick { textSize++ if (textSize > 50) textSize = 50 + seek_text_size.progress = textSize - 5 postEvent(Bus.UP_CONFIG, true) } iv_line_size_remove.onClick { textSize-- if (textSize < 5) textSize = 5 + seek_text_size.progress = textSize - 5 + postEvent(Bus.UP_CONFIG, true) + } + 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?) {} + }) + iv_text_letter_spacing_add.onClick { + letterSpacing += 0.1f + seek_text_letter_spacing.progress = (letterSpacing * 10).toInt() + 5 + postEvent(Bus.UP_CONFIG, true) + } + iv_text_letter_spacing_remove.onClick { + letterSpacing -= 0.1f + seek_text_letter_spacing.progress = (letterSpacing * 10).toInt() + 5 postEvent(Bus.UP_CONFIG, true) } rg_page_anim.onCheckedChange { _, checkedId -> diff --git a/app/src/main/res/layout/dialog_read_book_style.xml b/app/src/main/res/layout/dialog_read_book_style.xml index 2c84c4adf..0bb212cf4 100644 --- a/app/src/main/res/layout/dialog_read_book_style.xml +++ b/app/src/main/res/layout/dialog_read_book_style.xml @@ -84,10 +84,10 @@ android:text="@string/text_size" /> @@ -100,10 +100,10 @@ android:max="45" /> @@ -125,10 +125,10 @@ android:text="@string/text_letter_spacing" /> @@ -141,10 +141,10 @@ android:max="10" /> @@ -166,10 +166,10 @@ android:text="@string/line_size" /> @@ -182,10 +182,10 @@ android:max="50" />