From 7d57498581bde5c02561a15693e14d6a65c8d5d6 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 28 Aug 2019 15:53:06 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/help/ReadBookConfig.kt | 2 +- .../app/ui/readbook/config/ReadStyleDialog.kt | 4 ++-- .../io/legado/app/ui/widget/page/ContentView.kt | 2 +- app/src/main/res/layout/dialog_read_book_style.xml | 13 ++++++++++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 3708a7a1e..f7c9fb905 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -106,7 +106,7 @@ object ReadBookConfig { var bgType: Int = 0, var darkStatusIcon: Boolean = true, var letterSpacing: Float = 1f, - var lineSpacingExtra: Float = 15f, + var lineSpacingExtra: Int = 12, var lineSpacingMultiplier: Float = 1.2f, var paddingBottom: Int = 0, var paddingLeft: Int = 16, 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 660132f04..ea2d59215 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 @@ -74,7 +74,7 @@ class ReadStyleDialog : DialogFragment() { tv_text_size.text = it.textSize.toString() seek_text_letter_spacing.progress = (it.letterSpacing * 10).toInt() + 5 tv_text_letter_spacing.text = it.letterSpacing.toString() - seek_line_size.progress = it.lineSpacingExtra.toInt() + seek_line_size.progress = it.lineSpacingExtra tv_line_size.text = it.lineSpacingExtra.toString() } setBg() @@ -138,7 +138,7 @@ class ReadStyleDialog : DialogFragment() { seek_line_size.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { - lineSpacingExtra = seek_line_size.progress.toFloat() + lineSpacingExtra = seek_line_size.progress tv_line_size.text = lineSpacingExtra.toString() } diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index 3201328f7..f104bcde0 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -52,7 +52,7 @@ class ContentView : FrameLayout { } page_panel.setPadding(paddingLeft.dp, pt, paddingRight.dp, paddingBottom.dp) content_text_view.textSize = textSize.toFloat() - content_text_view.setLineSpacing(lineSpacingExtra, lineSpacingMultiplier) + content_text_view.setLineSpacing(lineSpacingExtra.toFloat(), lineSpacingMultiplier) content_text_view.letterSpacing = letterSpacing content_text_view.paint.isFakeBoldText = textBold textColor().let { 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 a5b11670c..599fe7832 100644 --- a/app/src/main/res/layout/dialog_read_book_style.xml +++ b/app/src/main/res/layout/dialog_read_book_style.xml @@ -1,6 +1,7 @@ + android:layout_height="wrap_content" + android:gravity="right" + tools:ignore="RtlHardcoded" /> + android:layout_height="wrap_content" + android:gravity="right" + tools:ignore="RtlHardcoded" /> @@ -201,7 +206,9 @@ + android:layout_height="wrap_content" + android:gravity="right" + tools:ignore="RtlHardcoded" />