From edfb3d007209a3e2c512cb4f75812d9d6915dd7b Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 20 Sep 2020 16:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E8=AF=BB=E4=BF=A1=E6=81=AF=E4=B9=A6?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/read/page/ContentView.kt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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 e89ee5ae8..166a9b731 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 @@ -11,6 +11,7 @@ import io.legado.app.base.BaseActivity import io.legado.app.constant.AppConst.timeFormat import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadTipConfig +import io.legado.app.service.help.ReadBook import io.legado.app.ui.book.read.page.entities.TextPage import io.legado.app.ui.book.read.page.provider.ChapterProvider import io.legado.app.ui.widget.BatteryView @@ -29,6 +30,7 @@ class ContentView(context: Context) : FrameLayout(context) { private var tvPage: BatteryView? = null private var tvTotalProgress: BatteryView? = null private var tvPageAndTotal: BatteryView? = null + private var tvBookName: BatteryView? = null val headerHeight: Int get() = if (ReadBookConfig.hideStatusBar) { @@ -185,6 +187,19 @@ class ContentView(context: Context) : FrameLayout(context) { isBattery = false textSize = 12f } + tvBookName = when (ReadTipConfig.bookName) { + ReadTipConfig.tipHeaderLeft -> bv_header_left + ReadTipConfig.tipHeaderMiddle -> tv_header_middle + ReadTipConfig.tipHeaderRight -> tv_header_right + ReadTipConfig.tipFooterLeft -> bv_footer_left + ReadTipConfig.tipFooterMiddle -> tv_footer_middle + ReadTipConfig.tipFooterRight -> tv_footer_right + else -> null + } + tvBookName?.apply { + isBattery = false + textSize = 12f + } } fun setBg(bg: Drawable?) { @@ -213,8 +228,8 @@ class ContentView(context: Context) : FrameLayout(context) { @SuppressLint("SetTextI18n") fun setProgress(textPage: TextPage) = textPage.apply { - val title = textPage.title - tvTitle?.text = title + tvBookName?.text = ReadBook.book?.name + tvTitle?.text = textPage.title tvPage?.text = "${index.plus(1)}/$pageSize" tvTotalProgress?.text = readProgress tvPageAndTotal?.text = "${index.plus(1)}/$pageSize $readProgress"