|
|
@ -200,64 +200,33 @@ class ReadStyleDialog : DialogFragment() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_bg0.onClick { |
|
|
|
tv_bg0.onClick { changeBg(0) } |
|
|
|
ReadBookConfig.styleSelect = 0 |
|
|
|
tv_bg0.onLongClick { showBgTextConfig(0) } |
|
|
|
ReadBookConfig.upBg() |
|
|
|
tv_bg1.onClick { changeBg(1) } |
|
|
|
upBg() |
|
|
|
tv_bg1.onLongClick { showBgTextConfig(1) } |
|
|
|
postEvent(Bus.UP_CONFIG, true) |
|
|
|
tv_bg2.onClick { changeBg(2) } |
|
|
|
} |
|
|
|
tv_bg2.onLongClick { showBgTextConfig(2) } |
|
|
|
tv_bg0.onLongClick { |
|
|
|
tv_bg3.onClick { changeBg(3) } |
|
|
|
showBgTextConfig() |
|
|
|
tv_bg3.onLongClick { showBgTextConfig(3) } |
|
|
|
false |
|
|
|
tv_bg4.onClick { changeBg(4) } |
|
|
|
} |
|
|
|
tv_bg4.onLongClick { showBgTextConfig(4) } |
|
|
|
tv_bg1.onClick { |
|
|
|
} |
|
|
|
ReadBookConfig.styleSelect = 1 |
|
|
|
|
|
|
|
ReadBookConfig.upBg() |
|
|
|
private fun changeBg(index: Int) { |
|
|
|
upBg() |
|
|
|
ReadBookConfig.styleSelect = index |
|
|
|
postEvent(Bus.UP_CONFIG, true) |
|
|
|
ReadBookConfig.upBg() |
|
|
|
} |
|
|
|
upBg() |
|
|
|
tv_bg1.onLongClick { |
|
|
|
postEvent(Bus.UP_CONFIG, true) |
|
|
|
showBgTextConfig() |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_bg2.onClick { |
|
|
|
|
|
|
|
ReadBookConfig.styleSelect = 2 |
|
|
|
|
|
|
|
ReadBookConfig.upBg() |
|
|
|
|
|
|
|
upBg() |
|
|
|
|
|
|
|
postEvent(Bus.UP_CONFIG, true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_bg2.onLongClick { |
|
|
|
|
|
|
|
showBgTextConfig() |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_bg3.onClick { |
|
|
|
|
|
|
|
ReadBookConfig.styleSelect = 3 |
|
|
|
|
|
|
|
ReadBookConfig.upBg() |
|
|
|
|
|
|
|
upBg() |
|
|
|
|
|
|
|
postEvent(Bus.UP_CONFIG, true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_bg3.onLongClick { |
|
|
|
|
|
|
|
showBgTextConfig() |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_bg4.onClick { |
|
|
|
|
|
|
|
ReadBookConfig.styleSelect = 4 |
|
|
|
|
|
|
|
ReadBookConfig.upBg() |
|
|
|
|
|
|
|
upBg() |
|
|
|
|
|
|
|
postEvent(Bus.UP_CONFIG, true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_bg4.onLongClick { |
|
|
|
|
|
|
|
showBgTextConfig() |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun showBgTextConfig() { |
|
|
|
private fun showBgTextConfig(index: Int): Boolean { |
|
|
|
dismiss() |
|
|
|
dismiss() |
|
|
|
|
|
|
|
changeBg(index) |
|
|
|
val activity = activity |
|
|
|
val activity = activity |
|
|
|
if (activity is ReadBookActivity) { |
|
|
|
if (activity is ReadBookActivity) { |
|
|
|
activity.showBgTextConfig() |
|
|
|
activity.showBgTextConfig() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun setBg() { |
|
|
|
private fun setBg() { |
|
|
|