diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 9df06f3c8..77dc45e9a 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -170,6 +170,17 @@ object ReadBookConfig { set(value) = if (shareLayout) shareConfig.titleMode = value else durConfig.titleMode = value + var titleTopSpacing: Int + get() = if (shareLayout) shareConfig.titleTopSpacing else durConfig.titleTopSpacing + set(value) = + if (shareLayout) shareConfig.titleTopSpacing = value + else durConfig.titleTopSpacing = value + var titleBottomSpacing: Int + get() = if (shareLayout) shareConfig.titleBottomSpacing else durConfig.titleBottomSpacing + set(value) = + if (shareLayout) shareConfig.titleBottomSpacing = value + else durConfig.titleBottomSpacing = value + var paddingBottom: Int get() = if (shareLayout) shareConfig.paddingBottom else durConfig.paddingBottom set(value) = @@ -238,6 +249,12 @@ object ReadBookConfig { if (shareLayout) shareConfig.footerPaddingTop = value else durConfig.footerPaddingTop = value + var showFooterLine: Boolean + get() = if (shareLayout) shareConfig.showFooterLine else durConfig.showFooterLine + set(value) = + if (shareLayout) shareConfig.showFooterLine = value + else durConfig.showFooterLine = value + @Keep class Config( private var bgStr: String = "#EEEEEE",//白天背景 diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt index bc9009257..6ce9dfc03 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt @@ -52,7 +52,7 @@ class PaddingConfigDialog : DialogFragment() { ReadBookConfig.save() } - private fun initData() = with(ReadBookConfig) { + private fun initData() = ReadBookConfig.apply { if (hideStatusBar) { ll_header_padding.visible() tv_body_padding.setPadding(0, 10.dp, 0, 10.dp) @@ -75,6 +75,7 @@ class PaddingConfigDialog : DialogFragment() { dsb_footer_padding_bottom.progress = footerPaddingBottom dsb_footer_padding_left.progress = footerPaddingLeft dsb_footer_padding_right.progress = footerPaddingRight + cb_show_line.isChecked = showFooterLine } private fun initView() = with(ReadBookConfig) { @@ -129,6 +130,12 @@ class PaddingConfigDialog : DialogFragment() { footerPaddingRight = it postEvent(EventBus.UP_CONFIG, true) } + cb_show_line.onCheckedChangeListener = { cb, isChecked -> + if (cb.isPressed) { + showFooterLine = isChecked + postEvent(EventBus.UP_CONFIG, true) + } + } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 7f1dcec1c..8e0bf1d55 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -60,6 +60,7 @@ class ContentView(context: Context) : FrameLayout(context) { footerPaddingRight.dp, footerPaddingBottom.dp ) + vw_bottom_divider.visible(showFooterLine) content_text_view.upVisibleRect() durConfig.textColor().let { tv_top_left.setTextColor(it) diff --git a/app/src/main/res/layout/dialog_read_padding.xml b/app/src/main/res/layout/dialog_read_padding.xml index 53bcbaeff..83bb14c71 100644 --- a/app/src/main/res/layout/dialog_read_padding.xml +++ b/app/src/main/res/layout/dialog_read_padding.xml @@ -109,6 +109,7 @@ android:text="@string/showLine" />