feat: 优化代码

pull/141/head
kunfei 5 years ago
parent bc24f16257
commit 4f1737cd12
  1. 5
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt
  2. 1
      app/src/main/res/layout/dialog_title_config.xml

@ -172,12 +172,17 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack {
.inflate(R.layout.dialog_title_config, null).apply { .inflate(R.layout.dialog_title_config, null).apply {
ReadBookConfig.apply { ReadBookConfig.apply {
rg_title_mode.checkByIndex(titleMode) rg_title_mode.checkByIndex(titleMode)
dsb_title_size.progress = titleSize
dsb_title_top.progress = titleTopSpacing dsb_title_top.progress = titleTopSpacing
dsb_title_bottom.progress = titleBottomSpacing dsb_title_bottom.progress = titleBottomSpacing
rg_title_mode.onCheckedChange { _, checkedId -> rg_title_mode.onCheckedChange { _, checkedId ->
titleMode = rg_title_mode.getIndexById(checkedId) titleMode = rg_title_mode.getIndexById(checkedId)
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)
} }
dsb_title_size.onChanged = {
titleSize = it
postEvent(EventBus.UP_CONFIG, true)
}
dsb_title_top.onChanged = { dsb_title_top.onChanged = {
titleTopSpacing = it titleTopSpacing = it
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)

@ -35,6 +35,7 @@
</RadioGroup> </RadioGroup>
<io.legado.app.ui.widget.DetailSeekBar <io.legado.app.ui.widget.DetailSeekBar
android:id="@+id/dsb_title_size"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="3dp" android:padding="3dp"

Loading…
Cancel
Save