From af9ad622bd72464ca21666cda66920560583ab9a Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 6 Mar 2020 17:00:57 +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 | 10 +- .../main/res/layout/dialog_read_padding.xml | 109 +++++++++++------- 2 files changed, 71 insertions(+), 48 deletions(-) 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 1155e1d7d..bc9009257 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 @@ -11,6 +11,7 @@ import io.legado.app.constant.EventBus import io.legado.app.help.ReadBookConfig import io.legado.app.ui.book.read.Help import io.legado.app.utils.dp +import io.legado.app.utils.gone import io.legado.app.utils.postEvent import io.legado.app.utils.visible import kotlinx.android.synthetic.main.dialog_read_padding.* @@ -53,12 +54,11 @@ class PaddingConfigDialog : DialogFragment() { private fun initData() = with(ReadBookConfig) { if (hideStatusBar) { - tv_header_padding.visible() - dsb_header_padding_top.visible() - dsb_header_padding_bottom.visible() - dsb_header_padding_left.visible() - dsb_header_padding_right.visible() + ll_header_padding.visible() tv_body_padding.setPadding(0, 10.dp, 0, 10.dp) + } else { + ll_header_padding.gone() + tv_body_padding.setPadding(0, 0.dp, 0, 10.dp) } //正文 dsb_padding_top.progress = paddingTop diff --git a/app/src/main/res/layout/dialog_read_padding.xml b/app/src/main/res/layout/dialog_read_padding.xml index 1b600959e..53bcbaeff 100644 --- a/app/src/main/res/layout/dialog_read_padding.xml +++ b/app/src/main/res/layout/dialog_read_padding.xml @@ -7,51 +7,55 @@ android:padding="10dp" android:orientation="vertical"> - - - - - - - - - + android:orientation="vertical"> + + + + + + + + + + + + @@ -84,13 +88,32 @@ app:title="@string/padding_right" app:max="100" /> - + android:gravity="center_vertical" + android:orientation="horizontal"> + + + + + + + +