From c3ba892fa397d8cd57548187a7862cd2cc9fa3d3 Mon Sep 17 00:00:00 2001 From: fansangg Date: Sun, 14 Jun 2026 04:50:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E9=A1=B5=E7=9C=89?= =?UTF-8?q?=E9=A1=B5=E8=84=9A=E9=97=B4=E8=B7=9D=E5=B1=95=E5=BC=80=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E5=B9=B6=E6=8F=90=E5=8F=96=E7=A1=AC=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E8=BE=B9=E8=B7=9D=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/book/read/sheet/HeaderFooterPage.kt | 37 +++++++++---------- app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/sheet/HeaderFooterPage.kt b/app/src/main/java/io/legado/app/ui/book/read/sheet/HeaderFooterPage.kt index 2ab8c1dc5..0919bcdba 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/sheet/HeaderFooterPage.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/sheet/HeaderFooterPage.kt @@ -2,7 +2,6 @@ package io.legado.app.ui.book.read.sheet import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.FastOutSlowInEasing -import androidx.compose.animation.core.LinearEasing import androidx.compose.animation.core.tween import androidx.compose.animation.expandVertically import androidx.compose.animation.fadeIn @@ -65,10 +64,8 @@ import io.legado.app.ui.widget.components.settingItem.TinySliderSettingItem import io.legado.app.ui.widget.components.settingItem.TinySwitchSettingItem import io.legado.app.ui.widget.components.tabRow.CardTabRow import io.legado.app.utils.getCompatColor -import kotlinx.coroutines.delay import kotlinx.coroutines.launch import org.koin.compose.koinInject -import kotlin.time.Duration.Companion.milliseconds // Color picker IDs private const val COLOR_HEADER = 7 @@ -124,25 +121,15 @@ internal fun HeaderFooterPage( val headerScrollState = rememberScrollState() val footerScrollState = rememberScrollState() - LaunchedEffect(expandHeaderPadding) { + LaunchedEffect(expandHeaderPadding, headerScrollState.maxValue) { if (expandHeaderPadding) { - //等动画结束后再滚动到底部,否则maxValue值不是最新 - delay(300.milliseconds) - headerScrollState.animateScrollTo( - headerScrollState.maxValue, - animationSpec = tween(durationMillis = 200, easing = LinearEasing) - ) + headerScrollState.scrollTo(headerScrollState.maxValue) } } - LaunchedEffect(expandFooterPadding) { + LaunchedEffect(expandFooterPadding, footerScrollState.maxValue) { if (expandFooterPadding) { - //等动画结束后再滚动到底部,否则maxValue值不是最新 - delay(300.milliseconds) - footerScrollState.animateScrollTo( - footerScrollState.maxValue, - animationSpec = tween(durationMillis = 200, easing = LinearEasing) - ) + footerScrollState.scrollTo(footerScrollState.maxValue) } } @@ -313,7 +300,13 @@ internal fun HeaderFooterPage( Spacer(Modifier.height(8.dp)) TinyClickableSettingItem( title = stringResource(R.string.padding), - description = "上: ${headerPaddingTop.toInt()} 下: ${headerPaddingBottom.toInt()} 左: ${headerPaddingLeft.toInt()} 右: ${headerPaddingRight.toInt()}", + description = stringResource( + R.string.padding_format, + headerPaddingTop.toInt(), + headerPaddingBottom.toInt(), + headerPaddingLeft.toInt(), + headerPaddingRight.toInt(), + ), trailingContent = { Icon( imageVector = if (expandHeaderPadding) Icons.Default.ExpandMore else Icons.Default.ChevronRight, @@ -437,7 +430,13 @@ internal fun HeaderFooterPage( Spacer(Modifier.height(8.dp)) TinyClickableSettingItem( title = stringResource(R.string.padding), - description = "上: ${footerPaddingTop.toInt()} 下: ${footerPaddingBottom.toInt()} 左: ${footerPaddingLeft.toInt()} 右: ${footerPaddingRight.toInt()}", + description = stringResource( + R.string.padding_format, + footerPaddingTop.toInt(), + footerPaddingBottom.toInt(), + footerPaddingLeft.toInt(), + footerPaddingRight.toInt(), + ), trailingContent = { Icon( imageVector = if (expandFooterPadding) Icons.Default.ExpandMore else Icons.Default.ChevronRight, diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 2364dff3a..073d0ae09 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -352,6 +352,7 @@ 下边距 左边距 右边距 + 上: %1$d 下: %2$d 左: %3$d 右: %4$d 校验书源 校验所选 %1$s 进度 %2$d/%3$d diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index a362ecf2a..663a98f39 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -299,6 +299,7 @@ 下邊距 左邊距 右邊距 + 上: %1$d 下: %2$d 左: %3$d 右: %4$d 校驗書源 校驗所選 %1$s 進度 %2$d/%3$d diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index dacc5b224..13fa803b2 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -301,6 +301,7 @@ 下邊距 左邊距 右邊距 + 上: %1$d 下: %2$d 左: %3$d 右: %4$d 校驗書源 校驗所選 %1$s 進度 %2$d/%3$d diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eb0394a28..bd7822aa7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -373,6 +373,7 @@ Bottom Left Right + Top: %1$d Bottom: %2$d Left: %3$d Right: %4$d Check book sources Check the selected source %1$s Progress %2$d/%3$d