页眉处标题未正常截断 #303

This commit is contained in:
HapeLee
2025-11-13 20:34:24 +08:00
parent cf1b6c405d
commit 747c940654
3 changed files with 44 additions and 23 deletions
@@ -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
+21 -14
View File
@@ -15,17 +15,24 @@
android:layout_height="wrap_content"
tools:ignore="UnusedAttribute">
<io.legado.app.ui.widget.image.CoverImageView
android:id="@+id/iv_cover"
android:layout_width="70dp"
android:layout_height="98dp"
android:scaleType="centerCrop"
<com.google.android.material.card.MaterialCardView
android:id="@+id/cd_cover"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:src="@drawable/image_cover_default"
app:strokeWidth="0dp"
app:cardCornerRadius="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:ignore="ImageContrastCheck" />
app:layout_constraintBottom_toBottomOf="parent">
<io.legado.app.ui.widget.image.CoverImageView
android:id="@+id/iv_cover"
android:layout_width="70dp"
android:layout_height="98dp"
android:scaleType="centerCrop"
android:src="@drawable/image_cover_default"
tools:ignore="ImageContrastCheck" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/rl_loading"
@@ -36,9 +43,9 @@
android:indeterminate="true"
android:visibility="invisible"
android:layout_gravity="top"
app:layout_constraintTop_toTopOf="@id/iv_cover"
app:layout_constraintStart_toStartOf="@id/iv_cover"
app:layout_constraintEnd_toEndOf="@id/iv_cover" />
app:layout_constraintTop_toTopOf="@id/cd_cover"
app:layout_constraintStart_toStartOf="@id/cd_cover"
app:layout_constraintEnd_toEndOf="@id/cd_cover" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/cd_unread"
@@ -49,8 +56,8 @@
app:cardCornerRadius="4dp"
app:strokeWidth="0dp"
app:cardBackgroundColor="?attr/colorSecondaryVariant"
app:layout_constraintTop_toTopOf="@id/iv_cover"
app:layout_constraintEnd_toEndOf="@id/iv_cover">
app:layout_constraintTop_toTopOf="@id/cd_cover"
app:layout_constraintEnd_toEndOf="@id/cd_cover">
<TextView
android:id="@+id/tv_unread"
@@ -74,7 +81,7 @@
android:gravity="center_vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_cover"
app:layout_constraintStart_toEndOf="@id/cd_cover"
app:layout_constraintEnd_toEndOf="parent">
<TextView
+1 -1
View File
@@ -9,7 +9,7 @@
<ImageView
android:id="@+id/arrow_icon"
android:layout_width="12dp"
android:layout_height="match_parent"
android:layout_height="12dp"
android:layout_marginEnd="8dp"
android:scaleType="center"
android:visibility="visible"