pull/951/head
gedoor 4 years ago
parent 346d1c60d8
commit e7fe6b0d83
  1. 8
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  2. 16
      app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt
  3. 12
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  4. 10
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt

@ -148,11 +148,9 @@ class BgTextConfigDialog : BaseDialogFragment() {
cancelButton()
}.show()
}
binding.swDarkStatusIcon.setOnCheckedChangeListener { buttonView, isChecked ->
if (buttonView?.isPressed == true) {
setCurStatusIconDark(isChecked)
(activity as? ReadBookActivity)?.upSystemUiVisibility()
}
binding.swDarkStatusIcon.setOnCheckedChangeListener { _, isChecked ->
setCurStatusIconDark(isChecked)
(activity as? ReadBookActivity)?.upSystemUiVisibility()
}
binding.tvTextColor.setOnClickListener {
ColorPickerDialog.newBuilder()

@ -121,17 +121,13 @@ class PaddingConfigDialog : BaseDialogFragment() {
footerPaddingRight = it
postEvent(EventBus.UP_CONFIG, true)
}
binding.cbShowTopLine.onCheckedChangeListener = { cb, isChecked ->
if (cb.isPressed) {
showHeaderLine = isChecked
postEvent(EventBus.UP_CONFIG, true)
}
binding.cbShowTopLine.onCheckedChangeListener = { _, isChecked ->
showHeaderLine = isChecked
postEvent(EventBus.UP_CONFIG, true)
}
binding.cbShowBottomLine.onCheckedChangeListener = { cb, isChecked ->
if (cb.isPressed) {
showFooterLine = isChecked
postEvent(EventBus.UP_CONFIG, true)
}
binding.cbShowBottomLine.onCheckedChangeListener = { _, isChecked ->
showFooterLine = isChecked
postEvent(EventBus.UP_CONFIG, true)
}
}

@ -81,8 +81,8 @@ class ReadAloudDialog : BaseDialogFragment() {
tvSetting.setTextColor(textColor)
cbTtsFollowSys.setTextColor(textColor)
}
initOnChange()
initData()
initOnChange()
initEvent()
}
@ -96,12 +96,10 @@ class ReadAloudDialog : BaseDialogFragment() {
}
private fun initOnChange() = with(binding) {
cbTtsFollowSys.setOnCheckedChangeListener { buttonView, isChecked ->
if (buttonView.isPressed) {
requireContext().putPrefBoolean("ttsFollowSys", isChecked)
seekTtsSpeechRate.isEnabled = !isChecked
upTtsSpeechRate()
}
cbTtsFollowSys.setOnCheckedChangeListener { _, isChecked ->
requireContext().putPrefBoolean("ttsFollowSys", isChecked)
seekTtsSpeechRate.isEnabled = !isChecked
upTtsSpeechRate()
}
seekTtsSpeechRate.setOnSeekBarChangeListener(object : SeekBarChangeListener {

@ -136,12 +136,10 @@ class ReadStyleDialog : BaseDialogFragment(), FontSelectDialog.CallBack {
ReadBookConfig.pageAnim = binding.rgPageAnim.getIndexById(checkedId)
callBack?.upPageAnim()
}
cbShareLayout.onCheckedChangeListener = { checkBox, isChecked ->
if (checkBox.isPressed) {
ReadBookConfig.shareLayout = isChecked
upView()
postEvent(EventBus.UP_CONFIG, true)
}
cbShareLayout.onCheckedChangeListener = { _, isChecked ->
ReadBookConfig.shareLayout = isChecked
upView()
postEvent(EventBus.UP_CONFIG, true)
}
dsbTextSize.onChanged = {
ReadBookConfig.textSize = it + 5

Loading…
Cancel
Save