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 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,

@ -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()
}

@ -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 {

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

Loading…
Cancel
Save