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

@ -148,12 +148,10 @@ 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()
.setColor(curTextColor()) .setColor(curTextColor())

@ -121,18 +121,14 @@ 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 = { _, isChecked ->
binding.cbShowBottomLine.onCheckedChangeListener = { cb, 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,13 +96,11 @@ 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 {
override fun onStopTrackingTouch(seekBar: SeekBar) { override fun onStopTrackingTouch(seekBar: SeekBar) {

@ -136,13 +136,11 @@ 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
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)

Loading…
Cancel
Save