pull/32/head
kunfei 5 years ago
parent 3df63c6f93
commit 7e9b427297
  1. 9
      app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt
  2. 18
      app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt
  3. 2
      app/src/main/res/layout/dialog_read_book_style.xml

@ -1,12 +1,13 @@
package io.legado.app.lib.theme.view package io.legado.app.lib.theme.view
import android.content.Context import android.content.Context
import android.graphics.Color
import android.util.AttributeSet import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatRadioButton import androidx.appcompat.widget.AppCompatRadioButton
import io.legado.app.R
import io.legado.app.lib.theme.Selector import io.legado.app.lib.theme.Selector
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.dp import io.legado.app.utils.dp
import io.legado.app.utils.getCompatColor
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
@ -27,11 +28,11 @@ class ATERadioNoButton : AppCompatRadioButton {
private fun init(context: Context, attrs: AttributeSet?) { private fun init(context: Context, attrs: AttributeSet?) {
background = Selector.shapeBuild() background = Selector.shapeBuild()
.setCornerRadius(3.dp) .setCornerRadius(2.dp)
.setStrokeWidth(3.dp) .setStrokeWidth(2.dp)
.setCheckedBgColor(ThemeStore.accentColor(context)) .setCheckedBgColor(ThemeStore.accentColor(context))
.setCheckedStrokeColor(ThemeStore.accentColor(context)) .setCheckedStrokeColor(ThemeStore.accentColor(context))
.setDefaultStrokeColor(Color.WHITE) .setDefaultStrokeColor(context.getCompatColor(R.color.tv_text_default))
.create() .create()
} }
} }

@ -125,6 +125,24 @@ class ReadStyleDialog : DialogFragment() {
seek_text_letter_spacing.progress = (letterSpacing * 10).toInt() + 5 seek_text_letter_spacing.progress = (letterSpacing * 10).toInt() + 5
postEvent(Bus.UP_CONFIG, true) postEvent(Bus.UP_CONFIG, true)
} }
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?) {}
})
iv_line_size_add.onClick {
lineSpacingExtra++
postEvent(Bus.UP_CONFIG, true)
}
iv_line_size_remove.onClick {
lineSpacingExtra--
postEvent(Bus.UP_CONFIG, true)
}
rg_page_anim.onCheckedChange { _, checkedId -> rg_page_anim.onCheckedChange { _, checkedId ->
for (i in 0 until rg_page_anim.childCount) { for (i in 0 until rg_page_anim.childCount) {
if (checkedId == rg_page_anim[i].id) { if (checkedId == rg_page_anim[i].id) {

@ -182,7 +182,7 @@
android:max="50" /> android:max="50" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_text_line_size_add" android:id="@+id/iv_line_size_add"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:src="@drawable/ic_add" android:src="@drawable/ic_add"

Loading…
Cancel
Save