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

@ -121,18 +121,14 @@ class PaddingConfigDialog : BaseDialogFragment() {
footerPaddingRight = it
postEvent(EventBus.UP_CONFIG, true)
}
binding.cbShowTopLine.onCheckedChangeListener = { cb, isChecked ->
if (cb.isPressed) {
binding.cbShowTopLine.onCheckedChangeListener = { _, isChecked ->
showHeaderLine = isChecked
postEvent(EventBus.UP_CONFIG, true)
}
}
binding.cbShowBottomLine.onCheckedChangeListener = { cb, isChecked ->
if (cb.isPressed) {
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,13 +96,11 @@ class ReadAloudDialog : BaseDialogFragment() {
}
private fun initOnChange() = with(binding) {
cbTtsFollowSys.setOnCheckedChangeListener { buttonView, isChecked ->
if (buttonView.isPressed) {
cbTtsFollowSys.setOnCheckedChangeListener { _, isChecked ->
requireContext().putPrefBoolean("ttsFollowSys", isChecked)
seekTtsSpeechRate.isEnabled = !isChecked
upTtsSpeechRate()
}
}
seekTtsSpeechRate.setOnSeekBarChangeListener(object : SeekBarChangeListener {
override fun onStopTrackingTouch(seekBar: SeekBar) {

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

Loading…
Cancel
Save