|
|
@ -166,31 +166,29 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("InflateParams") |
|
|
|
@SuppressLint("InflateParams") |
|
|
|
private fun showTitleConfig() { |
|
|
|
private fun showTitleConfig() = ReadBookConfig.apply { |
|
|
|
requireContext().alert(R.string.title) { |
|
|
|
requireContext().alert(R.string.title) { |
|
|
|
val rootView = LayoutInflater.from(requireContext()) |
|
|
|
val rootView = LayoutInflater.from(requireContext()) |
|
|
|
.inflate(R.layout.dialog_title_config, null).apply { |
|
|
|
.inflate(R.layout.dialog_title_config, null).apply { |
|
|
|
ReadBookConfig.apply { |
|
|
|
rg_title_mode.checkByIndex(titleMode) |
|
|
|
rg_title_mode.checkByIndex(titleMode) |
|
|
|
dsb_title_size.progress = titleSize |
|
|
|
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 = { |
|
|
|
dsb_title_size.onChanged = { |
|
|
|
titleSize = it |
|
|
|
titleSize = it |
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
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) |
|
|
|
} |
|
|
|
} |
|
|
|
dsb_title_bottom.onChanged = { |
|
|
|
dsb_title_bottom.onChanged = { |
|
|
|
titleBottomSpacing = it |
|
|
|
titleBottomSpacing = it |
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
postEvent(EventBus.UP_CONFIG, true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
customView = rootView |
|
|
|
customView = rootView |
|
|
|