fix: 修复共用布局下翻页动画文案读取错误
This commit is contained in:
1 parent
6dc79761f6
commit
25b79a0c58
2 files changed
+28
-3
No files matched your search
@@ -1542,6 +1542,7 @@ class ReadBookViewModel(
|
|||||||
|
|
||||||
private fun buildStyleConfig(): ReadBookStyleConfig {
|
private fun buildStyleConfig(): ReadBookStyleConfig {
|
||||||
val config = ReadBookConfig
|
val config = ReadBookConfig
|
||||||
|
val actualConfig = config.config
|
||||||
val dur = config.durConfig
|
val dur = config.durConfig
|
||||||
return ReadBookStyleConfig(
|
return ReadBookStyleConfig(
|
||||||
styleSelect = config.styleSelect,
|
styleSelect = config.styleSelect,
|
||||||
@@ -1560,8 +1561,8 @@ class ReadBookViewModel(
|
|||||||
textColor = dur.getTextColor(),
|
textColor = dur.getTextColor(),
|
||||||
textColorNight = dur.getTextColorNight(),
|
textColorNight = dur.getTextColorNight(),
|
||||||
textColorEInk = dur.getTextColorEInk(),
|
textColorEInk = dur.getTextColorEInk(),
|
||||||
pageAnim = dur.getPageAnim(),
|
pageAnim = actualConfig.getPageAnim(),
|
||||||
pageAnimEInk = dur.getPageAnimEInk(),
|
pageAnimEInk = actualConfig.getPageAnimEInk(),
|
||||||
shareLayout = config.shareLayout,
|
shareLayout = config.shareLayout,
|
||||||
configCount = config.configList.size,
|
configCount = config.configList.size,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -28,9 +28,15 @@ import androidx.compose.material.icons.filled.LightMode
|
|||||||
import androidx.compose.material.icons.filled.SpaceBar
|
import androidx.compose.material.icons.filled.SpaceBar
|
||||||
import androidx.compose.material.icons.filled.TextFields
|
import androidx.compose.material.icons.filled.TextFields
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.PlainTooltip
|
||||||
|
import androidx.compose.material3.TooltipAnchorPosition
|
||||||
|
import androidx.compose.material3.TooltipBox
|
||||||
|
import androidx.compose.material3.TooltipDefaults
|
||||||
|
import androidx.compose.material3.rememberTooltipState
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableIntStateOf
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
@@ -173,6 +179,23 @@ fun GlobalThemePage(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(start = 12.dp, end = 12.dp, bottom = 12.dp),
|
.padding(start = 12.dp, end = 12.dp, bottom = 12.dp),
|
||||||
|
) {
|
||||||
|
TooltipBox(
|
||||||
|
positionProvider = TooltipDefaults.rememberTooltipPositionProvider(
|
||||||
|
TooltipAnchorPosition.Above
|
||||||
|
),
|
||||||
|
tooltip = {
|
||||||
|
PlainTooltip(
|
||||||
|
containerColor = LegadoTheme.colorScheme.surfaceContainerLow,
|
||||||
|
contentColor = LegadoTheme.colorScheme.onSurface,
|
||||||
|
) {
|
||||||
|
AppText(
|
||||||
|
text = stringResource(R.string.share_layout),
|
||||||
|
style = LegadoTheme.typography.bodyMedium,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
state = rememberTooltipState(),
|
||||||
) {
|
) {
|
||||||
NormalCard(
|
NormalCard(
|
||||||
onClick = {
|
onClick = {
|
||||||
@@ -201,11 +224,12 @@ fun GlobalThemePage(
|
|||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.GridView,
|
Icons.Default.GridView,
|
||||||
contentDescription = null,
|
contentDescription = stringResource(R.string.share_layout),
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
val styleListState = rememberLazyListState()
|
val styleListState = rememberLazyListState()
|
||||||
|
|
||||||
// Auto-scroll to selected item (position as 2nd visible card)
|
// Auto-scroll to selected item (position as 2nd visible card)
|
||||||
|
|||||||
Reference in new issue
Block a user