fix: 大字模式优化
This commit is contained in:
@@ -12,6 +12,7 @@ import androidx.compose.material3.Text
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.unit.TextUnit
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import com.huaga.life_echo.ui.theme.AppDimensions
|
import com.huaga.life_echo.ui.theme.AppDimensions
|
||||||
@@ -27,12 +28,14 @@ import com.huaga.life_echo.ui.theme.AppTypography
|
|||||||
* - 支持夜间模式自动适配
|
* - 支持夜间模式自动适配
|
||||||
*
|
*
|
||||||
* @param title 区块标题(会自动转为大写)
|
* @param title 区块标题(会自动转为大写)
|
||||||
|
* @param titleFontSize 标题字号(默认 null 使用 sectionTitle,传入可与章节正文一致如 bodyMedium)
|
||||||
* @param modifier 外部修饰符
|
* @param modifier 外部修饰符
|
||||||
* @param content 卡片内容
|
* @param content 卡片内容
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun SectionCard(
|
fun SectionCard(
|
||||||
title: String,
|
title: String,
|
||||||
|
titleFontSize: TextUnit? = null,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
content: @Composable ColumnScope.() -> Unit
|
content: @Composable ColumnScope.() -> Unit
|
||||||
) {
|
) {
|
||||||
@@ -47,7 +50,7 @@ fun SectionCard(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = AppDimensions.tinySpacing)
|
.padding(horizontal = AppDimensions.tinySpacing)
|
||||||
.padding(bottom = 10.dp),
|
.padding(bottom = 10.dp),
|
||||||
fontSize = AppTypography.sectionTitle,
|
fontSize = titleFontSize ?: AppTypography.sectionTitle,
|
||||||
fontWeight = FontWeight.Medium,
|
fontWeight = FontWeight.Medium,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
letterSpacing = 0.5.sp
|
letterSpacing = 0.5.sp
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.unit.TextUnit
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.huaga.life_echo.ui.icons.AppIcons
|
import com.huaga.life_echo.ui.icons.AppIcons
|
||||||
import com.huaga.life_echo.ui.theme.AppDimensions
|
import com.huaga.life_echo.ui.theme.AppDimensions
|
||||||
@@ -58,6 +59,8 @@ enum class SettingItemType {
|
|||||||
* @param onPress 点击回调(箭头类型)
|
* @param onPress 点击回调(箭头类型)
|
||||||
* @param onToggle 开关变化回调(开关类型)
|
* @param onToggle 开关变化回调(开关类型)
|
||||||
* @param isLast 是否是最后一项(不显示分隔线)
|
* @param isLast 是否是最后一项(不显示分隔线)
|
||||||
|
* @param labelFontSize 标题字号(默认 null 使用 titleSmall,传入可与章节正文一致如 titleMedium)
|
||||||
|
* @param descriptionFontSize 描述字号(默认 null 使用 captionMedium,传入可与章节正文一致如 bodyMedium)
|
||||||
* @param modifier 外部修饰符
|
* @param modifier 外部修饰符
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
@@ -70,6 +73,8 @@ fun SettingItem(
|
|||||||
onPress: () -> Unit = {},
|
onPress: () -> Unit = {},
|
||||||
onToggle: (Boolean) -> Unit = {},
|
onToggle: (Boolean) -> Unit = {},
|
||||||
isLast: Boolean = false,
|
isLast: Boolean = false,
|
||||||
|
labelFontSize: TextUnit? = null,
|
||||||
|
descriptionFontSize: TextUnit? = null,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier
|
||||||
) {
|
) {
|
||||||
val contentColor = MaterialTheme.colorScheme.onSurface
|
val contentColor = MaterialTheme.colorScheme.onSurface
|
||||||
@@ -107,7 +112,7 @@ fun SettingItem(
|
|||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(
|
Text(
|
||||||
text = label,
|
text = label,
|
||||||
fontSize = AppTypography.titleSmall,
|
fontSize = labelFontSize ?: AppTypography.titleSmall,
|
||||||
fontWeight = FontWeight.Normal,
|
fontWeight = FontWeight.Normal,
|
||||||
color = contentColor
|
color = contentColor
|
||||||
)
|
)
|
||||||
@@ -115,7 +120,7 @@ fun SettingItem(
|
|||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Text(
|
Text(
|
||||||
text = description,
|
text = description,
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = descriptionFontSize ?: AppTypography.captionMedium,
|
||||||
color = secondaryColor
|
color = secondaryColor
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -166,6 +171,8 @@ fun SettingItem(
|
|||||||
* @param isLast 是否是最后一项
|
* @param isLast 是否是最后一项
|
||||||
* @param onClick 点击回调
|
* @param onClick 点击回调
|
||||||
* @param trailing 自定义尾部内容
|
* @param trailing 自定义尾部内容
|
||||||
|
* @param labelFontSize 标题字号(默认 null 使用 titleSmall)
|
||||||
|
* @param descriptionFontSize 描述字号(默认 null 使用 captionMedium)
|
||||||
* @param modifier 外部修饰符
|
* @param modifier 外部修饰符
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
@@ -176,6 +183,8 @@ fun SettingItemWithTrailing(
|
|||||||
isLast: Boolean = false,
|
isLast: Boolean = false,
|
||||||
onClick: () -> Unit = {},
|
onClick: () -> Unit = {},
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
labelFontSize: TextUnit? = null,
|
||||||
|
descriptionFontSize: TextUnit? = null,
|
||||||
trailing: @Composable () -> Unit
|
trailing: @Composable () -> Unit
|
||||||
) {
|
) {
|
||||||
val contentColor = MaterialTheme.colorScheme.onSurface
|
val contentColor = MaterialTheme.colorScheme.onSurface
|
||||||
@@ -213,7 +222,7 @@ fun SettingItemWithTrailing(
|
|||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(
|
Text(
|
||||||
text = label,
|
text = label,
|
||||||
fontSize = AppTypography.titleSmall,
|
fontSize = labelFontSize ?: AppTypography.titleSmall,
|
||||||
fontWeight = FontWeight.Normal,
|
fontWeight = FontWeight.Normal,
|
||||||
color = contentColor
|
color = contentColor
|
||||||
)
|
)
|
||||||
@@ -221,7 +230,7 @@ fun SettingItemWithTrailing(
|
|||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Text(
|
Text(
|
||||||
text = description,
|
text = description,
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = descriptionFontSize ?: AppTypography.captionMedium,
|
||||||
color = secondaryColor
|
color = secondaryColor
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ fun ConversationListItem(
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Text(
|
Text(
|
||||||
text = conversation.title,
|
text = conversation.title,
|
||||||
fontSize = AppTypography.titleSmall,
|
fontSize = AppTypography.titleMedium,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
color = DeepPurple,
|
color = DeepPurple,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
@@ -125,7 +125,7 @@ fun ConversationListItem(
|
|||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = TextUtils.ellipsizeSingleLine(conversation.latestMessagePreview, 60),
|
text = TextUtils.ellipsizeSingleLine(conversation.latestMessagePreview, 60),
|
||||||
fontSize = AppTypography.captionLarge,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = SlatePurple,
|
color = SlatePurple,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
@@ -136,11 +136,11 @@ fun ConversationListItem(
|
|||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.End
|
horizontalAlignment = Alignment.End
|
||||||
) {
|
) {
|
||||||
// 时间戳
|
// 时间戳(与章节正文字号一致,大字模式更易读)
|
||||||
TimeFormatter(
|
TimeFormatter(
|
||||||
timestamp = conversation.latestMessageTime,
|
timestamp = conversation.latestMessageTime,
|
||||||
textColor = SlatePurple,
|
textColor = SlatePurple,
|
||||||
fontSize = AppTypography.captionMedium
|
fontSize = AppTypography.bodyMedium
|
||||||
)
|
)
|
||||||
|
|
||||||
// 三个点菜单按钮(仅在非多选模式且可删除时显示)
|
// 三个点菜单按钮(仅在非多选模式且可删除时显示)
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ fun BookInfoCard(
|
|||||||
|
|
||||||
Spacer(modifier = Modifier.height(6.dp))
|
Spacer(modifier = Modifier.height(6.dp))
|
||||||
|
|
||||||
// 副标题
|
// 副标题(与章节正文字号一致,大字模式更易读)
|
||||||
Text(
|
Text(
|
||||||
text = "我的回忆录",
|
text = "我的回忆录",
|
||||||
fontSize = AppTypography.captionLarge,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = SlatePurple,
|
color = SlatePurple,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
@@ -73,7 +73,7 @@ fun BookInfoCard(
|
|||||||
if (book.total_words != null && book.total_words > 0) {
|
if (book.total_words != null && book.total_words > 0) {
|
||||||
Text(
|
Text(
|
||||||
text = "${book.total_words}字",
|
text = "${book.total_words}字",
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = MediumPurple
|
color = MediumPurple
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -81,13 +81,13 @@ fun BookInfoCard(
|
|||||||
if (book.total_words != null && book.total_words > 0) {
|
if (book.total_words != null && book.total_words > 0) {
|
||||||
Text(
|
Text(
|
||||||
text = " · ",
|
text = " · ",
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = MediumPurple
|
color = MediumPurple
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
text = "${book.total_pages}页",
|
text = "${book.total_pages}页",
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = MediumPurple
|
color = MediumPurple
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.huaga.life_echo.network.models.ChapterDto
|
import com.huaga.life_echo.network.models.ChapterDto
|
||||||
import com.huaga.life_echo.ui.components.common.MarkdownText
|
import com.huaga.life_echo.ui.components.common.MarkdownText
|
||||||
@@ -115,20 +114,20 @@ private fun FilledChapterCard(
|
|||||||
|
|
||||||
Spacer(modifier = Modifier.width(14.dp))
|
Spacer(modifier = Modifier.width(14.dp))
|
||||||
|
|
||||||
// 章节信息
|
// 章节信息(与章节正文字号一致,大字模式更易读;标题支持多行换行)
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(
|
Text(
|
||||||
text = chapter.title,
|
text = chapter.title,
|
||||||
fontSize = AppTypography.titleSmall,
|
fontSize = AppTypography.titleMedium,
|
||||||
fontWeight = FontWeight.Medium,
|
fontWeight = FontWeight.Medium,
|
||||||
color = DeepPurple,
|
lineHeight = AppTypography.lineHeightNormal,
|
||||||
maxLines = 1,
|
color = DeepPurple
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(AppDimensions.smallSpacing))
|
||||||
Text(
|
Text(
|
||||||
text = statusText,
|
text = statusText,
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
|
lineHeight = AppTypography.lineHeightNormal,
|
||||||
color = if (isComplete) MediumPurple else SlatePurple
|
color = if (isComplete) MediumPurple else SlatePurple
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -144,7 +143,7 @@ private fun FilledChapterCard(
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "新",
|
text = "新",
|
||||||
fontSize = AppTypography.captionSmall,
|
fontSize = AppTypography.captionMedium,
|
||||||
color = AppWhite,
|
color = AppWhite,
|
||||||
fontWeight = FontWeight.Medium
|
fontWeight = FontWeight.Medium
|
||||||
)
|
)
|
||||||
@@ -246,19 +245,20 @@ private fun EmptyChapterCard(
|
|||||||
|
|
||||||
Spacer(modifier = Modifier.width(14.dp))
|
Spacer(modifier = Modifier.width(14.dp))
|
||||||
|
|
||||||
// 章节标题和提示(标题支持多行换行,设置行高避免两行挤在一起)
|
// 章节标题和提示(与章节正文字号一致,大字模式更易读)
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(
|
Text(
|
||||||
text = chapter.title,
|
text = chapter.title,
|
||||||
fontSize = AppTypography.titleSmall,
|
fontSize = AppTypography.titleMedium,
|
||||||
fontWeight = FontWeight.Medium,
|
fontWeight = FontWeight.Medium,
|
||||||
lineHeight = AppTypography.lineHeightTight,
|
lineHeight = AppTypography.lineHeightNormal,
|
||||||
color = SlatePurple
|
color = SlatePurple
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(AppDimensions.smallSpacing))
|
||||||
Text(
|
Text(
|
||||||
text = "还没有内容,去和岁月知己聊聊吧",
|
text = "还没有内容,去和岁月知己聊聊吧",
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
|
lineHeight = AppTypography.lineHeightNormal,
|
||||||
color = SlatePurple.copy(alpha = 0.7f)
|
color = SlatePurple.copy(alpha = 0.7f)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -275,7 +275,7 @@ private fun EmptyChapterCard(
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "去聊天",
|
text = "去聊天",
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
fontWeight = FontWeight.Medium,
|
fontWeight = FontWeight.Medium,
|
||||||
color = DeepPurple.copy(alpha = 0.7f)
|
color = DeepPurple.copy(alpha = 0.7f)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -208,14 +208,14 @@ fun ConversationListScreen(
|
|||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
contentPadding = PaddingValues(bottom = AppDimensions.screenPadding)
|
contentPadding = PaddingValues(bottom = AppDimensions.screenPadding)
|
||||||
) {
|
) {
|
||||||
// 区块标题
|
// 区块标题(与章节正文字号一致,大字模式更易读)
|
||||||
item {
|
item {
|
||||||
Text(
|
Text(
|
||||||
text = "我的对话",
|
text = "我的对话",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = AppDimensions.screenPadding)
|
.padding(horizontal = AppDimensions.screenPadding)
|
||||||
.padding(top = AppDimensions.cardPadding, bottom = 10.dp),
|
.padding(top = AppDimensions.cardPadding, bottom = 10.dp),
|
||||||
fontSize = AppTypography.captionLarge,
|
fontSize = AppTypography.bodyMedium,
|
||||||
fontWeight = FontWeight.Medium,
|
fontWeight = FontWeight.Medium,
|
||||||
color = SlatePurple,
|
color = SlatePurple,
|
||||||
letterSpacing = 0.5.sp
|
letterSpacing = 0.5.sp
|
||||||
@@ -375,7 +375,7 @@ private fun TipCard(modifier: Modifier = Modifier) {
|
|||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "每天花几分钟聊聊往事,岁月知己会帮您把珍贵的回忆整理成一本专属回忆录。童年趣事、求学时光、工作历程……随时想聊就聊。",
|
text = "每天花几分钟聊聊往事,岁月知己会帮您把珍贵的回忆整理成一本专属回忆录。童年趣事、求学时光、工作历程……随时想聊就聊。",
|
||||||
fontSize = AppTypography.captionLarge,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = SlatePurple,
|
color = SlatePurple,
|
||||||
lineHeight = AppTypography.lineHeightNormal
|
lineHeight = AppTypography.lineHeightNormal
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import com.huaga.life_echo.ui.components.memoir.ChapterCard
|
|||||||
import com.huaga.life_echo.ui.components.memoir.ChapterReadingView
|
import com.huaga.life_echo.ui.components.memoir.ChapterReadingView
|
||||||
import com.huaga.life_echo.ui.components.memoir.FullTextReadingView
|
import com.huaga.life_echo.ui.components.memoir.FullTextReadingView
|
||||||
import com.huaga.life_echo.ui.icons.AppIcons
|
import com.huaga.life_echo.ui.icons.AppIcons
|
||||||
|
import com.huaga.life_echo.ui.settings.AppSettings
|
||||||
import com.huaga.life_echo.ui.theme.*
|
import com.huaga.life_echo.ui.theme.*
|
||||||
import com.huaga.life_echo.ui.viewmodel.MyMemoirViewModel
|
import com.huaga.life_echo.ui.viewmodel.MyMemoirViewModel
|
||||||
import com.huaga.life_echo.ui.viewmodel.ViewModelFactory
|
import com.huaga.life_echo.ui.viewmodel.ViewModelFactory
|
||||||
@@ -321,7 +322,7 @@ fun MyMemoirScreen(
|
|||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
Text(
|
Text(
|
||||||
text = "清除回忆",
|
text = "清除回忆",
|
||||||
fontSize = AppTypography.captionLarge
|
fontSize = AppTypography.bodyMedium
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -377,6 +378,10 @@ private fun MemoirTableOfContents(
|
|||||||
onSubtitleChange: (String) -> Unit,
|
onSubtitleChange: (String) -> Unit,
|
||||||
onNavigateToChat: () -> Unit
|
onNavigateToChat: () -> Unit
|
||||||
) {
|
) {
|
||||||
|
val isLargeFontMode = AppSettings.rememberLargeFontMode()
|
||||||
|
val headerBottomPadding = if (isLargeFontMode) AppDimensions.sectionSpacing else 8.dp
|
||||||
|
val cardSpacing = if (isLargeFontMode) AppDimensions.sectionSpacing else AppDimensions.itemSpacing
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
@@ -419,7 +424,7 @@ private fun MemoirTableOfContents(
|
|||||||
"开始和岁月知己聊天吧"
|
"开始和岁月知己聊天吧"
|
||||||
},
|
},
|
||||||
updatedAt = bookInfo?.let { "下拉刷新获取最新内容" } ?: "",
|
updatedAt = bookInfo?.let { "下拉刷新获取最新内容" } ?: "",
|
||||||
modifier = Modifier.padding(bottom = 8.dp)
|
modifier = Modifier.padding(bottom = headerBottomPadding)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,11 +433,11 @@ private fun MemoirTableOfContents(
|
|||||||
ChapterProgressHint(
|
ChapterProgressHint(
|
||||||
totalChapters = chapterDtos.size,
|
totalChapters = chapterDtos.size,
|
||||||
filledChapters = contentChapterCount,
|
filledChapters = contentChapterCount,
|
||||||
modifier = Modifier.padding(bottom = AppDimensions.itemSpacing)
|
modifier = Modifier.padding(bottom = cardSpacing)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 章节列表(始终显示所有章节)
|
// 章节列表(始终显示所有章节);大字模式下卡片间距更大
|
||||||
items(chapterDtos, key = { it.id }) { chapterDto ->
|
items(chapterDtos, key = { it.id }) { chapterDto ->
|
||||||
val isEmpty = chapterDto.content.isBlank()
|
val isEmpty = chapterDto.content.isBlank()
|
||||||
ChapterCard(
|
ChapterCard(
|
||||||
@@ -441,7 +446,7 @@ private fun MemoirTableOfContents(
|
|||||||
onClick = { onChapterClick(chapterDto) },
|
onClick = { onChapterClick(chapterDto) },
|
||||||
onGoChat = if (isEmpty) onNavigateToChat else null
|
onGoChat = if (isEmpty) onNavigateToChat else null
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(AppDimensions.itemSpacing))
|
Spacer(modifier = Modifier.height(cardSpacing))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 底部空间,为浮动按钮留出空间
|
// 底部空间,为浮动按钮留出空间
|
||||||
@@ -508,7 +513,7 @@ private fun ChapterProgressHint(
|
|||||||
} else {
|
} else {
|
||||||
"所有章节已完成"
|
"所有章节已完成"
|
||||||
},
|
},
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = SlatePurple,
|
color = SlatePurple,
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
)
|
)
|
||||||
@@ -543,7 +548,7 @@ private fun BookHeaderCard(
|
|||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = subtitle,
|
text = subtitle,
|
||||||
fontSize = AppTypography.captionLarge,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = SlatePurple,
|
color = SlatePurple,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
@@ -552,7 +557,7 @@ private fun BookHeaderCard(
|
|||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
Text(
|
Text(
|
||||||
text = updatedAt,
|
text = updatedAt,
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = MediumPurple.copy(alpha = 0.7f),
|
color = MediumPurple.copy(alpha = 0.7f),
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -161,13 +161,15 @@ fun ProfileScreen(
|
|||||||
// 账户管理(登录后显示)
|
// 账户管理(登录后显示)
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
item {
|
item {
|
||||||
SectionCard(title = "账户管理") {
|
SectionCard(title = "账户管理", titleFontSize = AppTypography.bodyMedium) {
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.ManageAccounts,
|
icon = AppIcons.ManageAccounts,
|
||||||
label = "账户管理",
|
label = "账户管理",
|
||||||
description = "修改密码、手机号、登出管理",
|
description = "修改密码、手机号、登出管理",
|
||||||
onPress = { navController?.navigate(Screen.AccountManagement.route) },
|
onPress = { navController?.navigate(Screen.AccountManagement.route) },
|
||||||
isLast = true
|
isLast = true,
|
||||||
|
labelFontSize = AppTypography.titleMedium,
|
||||||
|
descriptionFontSize = AppTypography.bodyMedium
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,31 +209,35 @@ fun ProfileScreen(
|
|||||||
|
|
||||||
// 数据与隐私
|
// 数据与隐私
|
||||||
item {
|
item {
|
||||||
SectionCard(title = "数据与隐私") {
|
SectionCard(title = "数据与隐私", titleFontSize = AppTypography.bodyMedium) {
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.FileDownload,
|
icon = AppIcons.FileDownload,
|
||||||
label = "导出所有数据",
|
label = "导出所有数据",
|
||||||
onPress = { navController?.navigate(Screen.ExportData.route) },
|
onPress = { navController?.navigate(Screen.ExportData.route) },
|
||||||
isLast = true
|
isLast = true,
|
||||||
|
labelFontSize = AppTypography.titleMedium
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置
|
// 设置
|
||||||
item {
|
item {
|
||||||
SectionCard(title = "设置") {
|
SectionCard(title = "设置", titleFontSize = AppTypography.bodyMedium) {
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.AccessTime,
|
icon = AppIcons.AccessTime,
|
||||||
label = "语速",
|
label = "语速",
|
||||||
description = "标准",
|
description = "标准",
|
||||||
onPress = { showSpeechRateDialog = true }
|
onPress = { showSpeechRateDialog = true },
|
||||||
|
labelFontSize = AppTypography.titleMedium,
|
||||||
|
descriptionFontSize = AppTypography.bodyMedium
|
||||||
)
|
)
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.Brightness2,
|
icon = AppIcons.Brightness2,
|
||||||
label = "夜间模式",
|
label = "夜间模式",
|
||||||
type = SettingItemType.TOGGLE,
|
type = SettingItemType.TOGGLE,
|
||||||
value = darkMode,
|
value = darkMode,
|
||||||
onToggle = { darkMode = it }
|
onToggle = { darkMode = it },
|
||||||
|
labelFontSize = AppTypography.titleMedium
|
||||||
)
|
)
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.FormatSize,
|
icon = AppIcons.FormatSize,
|
||||||
@@ -240,42 +246,48 @@ fun ProfileScreen(
|
|||||||
type = SettingItemType.TOGGLE,
|
type = SettingItemType.TOGGLE,
|
||||||
value = largeFontMode,
|
value = largeFontMode,
|
||||||
onToggle = { largeFontMode = it },
|
onToggle = { largeFontMode = it },
|
||||||
isLast = true
|
isLast = true,
|
||||||
|
labelFontSize = AppTypography.titleMedium,
|
||||||
|
descriptionFontSize = AppTypography.bodyMedium
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 帮助与支持
|
// 帮助与支持
|
||||||
item {
|
item {
|
||||||
SectionCard(title = "帮助与支持") {
|
SectionCard(title = "帮助与支持", titleFontSize = AppTypography.bodyMedium) {
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.Help,
|
icon = AppIcons.Help,
|
||||||
label = "常见问题",
|
label = "常见问题",
|
||||||
onPress = { navController?.navigate(Screen.FAQ.route) }
|
onPress = { navController?.navigate(Screen.FAQ.route) },
|
||||||
|
labelFontSize = AppTypography.titleMedium
|
||||||
)
|
)
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.Info,
|
icon = AppIcons.Info,
|
||||||
label = "反馈与客服",
|
label = "反馈与客服",
|
||||||
onPress = { navController?.navigate(Screen.Feedback.route) }
|
onPress = { navController?.navigate(Screen.Feedback.route) },
|
||||||
|
labelFontSize = AppTypography.titleMedium
|
||||||
)
|
)
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = AppIcons.Info,
|
icon = AppIcons.Info,
|
||||||
label = "关于我们",
|
label = "关于我们",
|
||||||
description = "版本 1.0.0",
|
description = "版本 1.0.0",
|
||||||
onPress = { navController?.navigate(Screen.About.route) },
|
onPress = { navController?.navigate(Screen.About.route) },
|
||||||
isLast = true
|
isLast = true,
|
||||||
|
labelFontSize = AppTypography.titleMedium,
|
||||||
|
descriptionFontSize = AppTypography.bodyMedium
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 版本信息
|
// 版本信息(与章节正文字号一致)
|
||||||
item {
|
item {
|
||||||
Text(
|
Text(
|
||||||
text = "版本 1.0.0",
|
text = "版本 1.0.0",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(vertical = AppDimensions.sectionSpacing),
|
.padding(vertical = AppDimensions.sectionSpacing),
|
||||||
fontSize = AppTypography.captionMedium,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = androidx.compose.material3.MaterialTheme.colorScheme.onSurfaceVariant,
|
color = androidx.compose.material3.MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
@@ -372,7 +384,7 @@ private fun ProfileHeader(
|
|||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "登录以同步您的数据",
|
text = "登录以同步您的数据",
|
||||||
fontSize = AppTypography.bodySmall,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = secondaryColor
|
color = secondaryColor
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -421,7 +433,7 @@ private fun PlanBadge(planName: String) {
|
|||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = planName,
|
text = planName,
|
||||||
fontSize = AppTypography.captionLarge,
|
fontSize = AppTypography.bodyMedium,
|
||||||
color = MediumPurple
|
color = MediumPurple
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,10 +151,10 @@ private val LargeTypography = AppTypographyData(
|
|||||||
headingLarge = 38.sp,
|
headingLarge = 38.sp,
|
||||||
headingMedium = 29.sp,
|
headingMedium = 29.sp,
|
||||||
headingSmall = 24.sp,
|
headingSmall = 24.sp,
|
||||||
titleLarge = 22.sp,
|
titleLarge = 24.sp,
|
||||||
titleMedium = 22.sp,
|
titleMedium = 22.sp,
|
||||||
titleSmall = 18.sp,
|
titleSmall = 18.sp,
|
||||||
bodyLarge = 22.sp,
|
bodyLarge = 24.sp,
|
||||||
bodyMedium = 22.sp,
|
bodyMedium = 22.sp,
|
||||||
bodySmall = 16.sp,
|
bodySmall = 16.sp,
|
||||||
captionLarge = 16.sp,
|
captionLarge = 16.sp,
|
||||||
|
|||||||
Reference in New Issue
Block a user