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() cancelButton()
}.show() }.show()
} }
binding.swDarkStatusIcon.setOnCheckedChangeListener { buttonView, isChecked -> binding.swDarkStatusIcon.setOnCheckedChangeListener { _, isChecked ->
if (buttonView?.isPressed == true) { setCurStatusIconDark(isChecked)
setCurStatusIconDark(isChecked) (activity as? ReadBookActivity)?.upSystemUiVisibility()
(activity as? ReadBookActivity)?.upSystemUiVisibility()
}
} }
binding.tvTextColor.setOnClickListener { binding.tvTextColor.setOnClickListener {
ColorPickerDialog.newBuilder() ColorPickerDialog.newBuilder()

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

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

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

Loading…
Cancel
Save