From 747c9406542426b4e4de2b729641fb636b8d6f36 Mon Sep 17 00:00:00 2001 From: HapeLee <1321903405@qq.com> Date: Thu, 13 Nov 2025 20:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E7=9C=89=E5=A4=84=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=9C=AA=E6=AD=A3=E5=B8=B8=E6=88=AA=E6=96=AD=20#303?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/read/page/PageView.kt | 30 +++++++++++----- .../main/res/layout/item_bookshelf_list.xml | 35 +++++++++++-------- app/src/main/res/layout/view_battery.xml | 2 +- 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index 20d0d57a5..5f7853784 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -179,16 +179,30 @@ class PageView(context: Context) : FrameLayout(context) { ReadTipConfig.apply { tvHeaderLeft.isGone = tipHeaderLeft == none tvHeaderMiddle.isGone = tipHeaderMiddle == none - if (tvHeaderLeft.isGone && tvHeaderMiddle.isGone) - tvHeaderRight.isGone = tipHeaderRight == none - else - tvHeaderRight.isInvisible = tipHeaderRight == none + if (tipHeaderRight == none) { + if (tipHeaderMiddle == none && tipHeaderLeft == none) { + tvHeaderRight.isGone = true + } else { + tvHeaderRight.isGone = false + tvHeaderRight.batteryMode = BatteryView.BatteryMode.EMPTY + } + } else { + tvHeaderRight.isGone = false + tvHeaderRight.batteryMode = BatteryView.BatteryMode.NO_BATTERY + } tvFooterLeft.isGone = tipFooterLeft == none tvFooterMiddle.isGone = tipFooterMiddle == none - if (tvFooterLeft.isGone && tvFooterMiddle.isGone) - tvFooterRight.isGone = tipFooterRight == none - else - tvFooterRight.isInvisible = tipFooterRight == none + if (tipFooterRight == none) { + if (tipFooterLeft == none && tipFooterMiddle == none) { + tvFooterRight.isGone = true + } else { + tvFooterRight.isGone = false + tvFooterRight.batteryMode = BatteryView.BatteryMode.EMPTY + } + } else { + tvFooterRight.isGone = false + tvFooterRight.batteryMode = BatteryView.BatteryMode.NO_BATTERY + } } tvTitle = getTipView(ReadTipConfig.chapterTitle)?.apply { tag = ReadTipConfig.chapterTitle diff --git a/app/src/main/res/layout/item_bookshelf_list.xml b/app/src/main/res/layout/item_bookshelf_list.xml index 3be984548..123c2a8a4 100644 --- a/app/src/main/res/layout/item_bookshelf_list.xml +++ b/app/src/main/res/layout/item_bookshelf_list.xml @@ -15,17 +15,24 @@ android:layout_height="wrap_content" tools:ignore="UnusedAttribute"> - + app:layout_constraintBottom_toBottomOf="parent"> + + + app:layout_constraintTop_toTopOf="@id/cd_cover" + app:layout_constraintStart_toStartOf="@id/cd_cover" + app:layout_constraintEnd_toEndOf="@id/cd_cover" /> + app:layout_constraintTop_toTopOf="@id/cd_cover" + app:layout_constraintEnd_toEndOf="@id/cd_cover">