From 3a3b1872f49e484b631e093d2e9cc280a8b1a656 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 15 Feb 2020 22:42:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../book/read/config/PaddingConfigDialog.kt | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) 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 0d16229b0..f458ddfa5 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 @@ -45,13 +45,25 @@ class PaddingConfigDialog : DialogFragment() { } private fun initData() = with(ReadBookConfig.getConfig()) { + //正文 dsb_padding_top.progress = paddingTop dsb_padding_bottom.progress = paddingBottom dsb_padding_left.progress = paddingLeft dsb_padding_right.progress = paddingRight + //页眉 + dsb_header_padding_top.progress = headerPaddingTop + dsb_header_padding_bottom.progress = headerPaddingBottom + dsb_header_padding_left.progress = headerPaddingLeft + dsb_header_padding_right.progress = headerPaddingRight + //页脚 + dsb_footer_padding_top.progress = footerPaddingTop + dsb_footer_padding_bottom.progress = footerPaddingBottom + dsb_footer_padding_left.progress = footerPaddingLeft + dsb_footer_padding_right.progress = footerPaddingRight } private fun initView() = with(ReadBookConfig.getConfig()) { + //正文 dsb_padding_top.onChanged = { paddingTop = it postEvent(EventBus.UP_CONFIG, true) @@ -68,6 +80,40 @@ class PaddingConfigDialog : DialogFragment() { paddingRight = it postEvent(EventBus.UP_CONFIG, true) } + //页眉 + dsb_header_padding_top.onChanged = { + headerPaddingTop = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_header_padding_bottom.onChanged = { + headerPaddingBottom = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_header_padding_left.onChanged = { + headerPaddingLeft = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_header_padding_right.onChanged = { + headerPaddingRight = it + postEvent(EventBus.UP_CONFIG, true) + } + //页脚 + dsb_footer_padding_top.onChanged = { + footerPaddingTop = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_footer_padding_bottom.onChanged = { + footerPaddingBottom = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_footer_padding_left.onChanged = { + footerPaddingLeft = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_footer_padding_right.onChanged = { + footerPaddingRight = it + postEvent(EventBus.UP_CONFIG, true) + } } }