|
|
@ -76,6 +76,7 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun initData() { |
|
|
|
private fun initData() { |
|
|
|
|
|
|
|
cb_share_layout.isChecked = getPrefBoolean(PreferKey.shareLayout) |
|
|
|
requireContext().getPrefInt(PreferKey.pageAnim).let { |
|
|
|
requireContext().getPrefInt(PreferKey.pageAnim).let { |
|
|
|
if (it >= 0 && it < rg_page_anim.childCount) { |
|
|
|
if (it >= 0 && it < rg_page_anim.childCount) { |
|
|
|
rg_page_anim.check(rg_page_anim[it].id) |
|
|
|
rg_page_anim.check(rg_page_anim[it].id) |
|
|
@ -90,6 +91,13 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { |
|
|
|
chinese_converter.onChanged { |
|
|
|
chinese_converter.onChanged { |
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
tv_title_center.onClick { |
|
|
|
|
|
|
|
ReadBookConfig.durConfig.apply { |
|
|
|
|
|
|
|
titleCenter = !titleCenter |
|
|
|
|
|
|
|
tv_text_bold.isSelected = titleCenter |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
|
|
|
|
} |
|
|
|
tv_text_bold.onClick { |
|
|
|
tv_text_bold.onClick { |
|
|
|
ReadBookConfig.durConfig.apply { |
|
|
|
ReadBookConfig.durConfig.apply { |
|
|
|
textBold = !textBold |
|
|
|
textBold = !textBold |
|
|
@ -144,6 +152,11 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
cb_share_layout.onCheckedChangeListener = { checkBox, isChecked -> |
|
|
|
|
|
|
|
if (checkBox.isPressed) { |
|
|
|
|
|
|
|
putPrefBoolean(PreferKey.shareLayout, isChecked) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
bg0.onClick { changeBg(0) } |
|
|
|
bg0.onClick { changeBg(0) } |
|
|
|
bg0.onLongClick { showBgTextConfig(0) } |
|
|
|
bg0.onLongClick { showBgTextConfig(0) } |
|
|
|
bg1.onClick { changeBg(1) } |
|
|
|
bg1.onClick { changeBg(1) } |
|
|
@ -178,6 +191,7 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { |
|
|
|
|
|
|
|
|
|
|
|
private fun upStyle() { |
|
|
|
private fun upStyle() { |
|
|
|
ReadBookConfig.durConfig.let { |
|
|
|
ReadBookConfig.durConfig.let { |
|
|
|
|
|
|
|
tv_title_center.isSelected = it.titleCenter |
|
|
|
tv_text_bold.isSelected = it.textBold |
|
|
|
tv_text_bold.isSelected = it.textBold |
|
|
|
dsb_text_size.progress = it.textSize - 5 |
|
|
|
dsb_text_size.progress = it.textSize - 5 |
|
|
|
dsb_text_letter_spacing.progress = (it.letterSpacing * 100).toInt() + 50 |
|
|
|
dsb_text_letter_spacing.progress = (it.letterSpacing * 100).toInt() + 50 |
|
|
|