pull/32/head
kunfei 5 years ago
parent b9b52ae32b
commit 7d57498581
  1. 2
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  2. 4
      app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt
  3. 2
      app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt
  4. 13
      app/src/main/res/layout/dialog_read_book_style.xml

@ -106,7 +106,7 @@ object ReadBookConfig {
var bgType: Int = 0, var bgType: Int = 0,
var darkStatusIcon: Boolean = true, var darkStatusIcon: Boolean = true,
var letterSpacing: Float = 1f, var letterSpacing: Float = 1f,
var lineSpacingExtra: Float = 15f, var lineSpacingExtra: Int = 12,
var lineSpacingMultiplier: Float = 1.2f, var lineSpacingMultiplier: Float = 1.2f,
var paddingBottom: Int = 0, var paddingBottom: Int = 0,
var paddingLeft: Int = 16, var paddingLeft: Int = 16,

@ -74,7 +74,7 @@ class ReadStyleDialog : DialogFragment() {
tv_text_size.text = it.textSize.toString() tv_text_size.text = it.textSize.toString()
seek_text_letter_spacing.progress = (it.letterSpacing * 10).toInt() + 5 seek_text_letter_spacing.progress = (it.letterSpacing * 10).toInt() + 5
tv_text_letter_spacing.text = it.letterSpacing.toString() 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() tv_line_size.text = it.lineSpacingExtra.toString()
} }
setBg() setBg()
@ -138,7 +138,7 @@ class ReadStyleDialog : DialogFragment() {
seek_line_size.setOnSeekBarChangeListener(object : seek_line_size.setOnSeekBarChangeListener(object :
SeekBar.OnSeekBarChangeListener { SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { 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() tv_line_size.text = lineSpacingExtra.toString()
} }

@ -52,7 +52,7 @@ class ContentView : FrameLayout {
} }
page_panel.setPadding(paddingLeft.dp, pt, paddingRight.dp, paddingBottom.dp) page_panel.setPadding(paddingLeft.dp, pt, paddingRight.dp, paddingBottom.dp)
content_text_view.textSize = textSize.toFloat() 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.letterSpacing = letterSpacing
content_text_view.paint.isFakeBoldText = textBold content_text_view.paint.isFakeBoldText = textBold
textColor().let { textColor().let {

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -110,7 +111,9 @@
<TextView <TextView
android:id="@+id/tv_text_size" android:id="@+id/tv_text_size"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:gravity="right"
tools:ignore="RtlHardcoded" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -155,7 +158,9 @@
<TextView <TextView
android:id="@+id/tv_text_letter_spacing" android:id="@+id/tv_text_letter_spacing"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:gravity="right"
tools:ignore="RtlHardcoded" />
</LinearLayout> </LinearLayout>
@ -201,7 +206,9 @@
<TextView <TextView
android:id="@+id/tv_line_size" android:id="@+id/tv_line_size"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:gravity="right"
tools:ignore="RtlHardcoded" />
</LinearLayout> </LinearLayout>
<View <View

Loading…
Cancel
Save