文本资源文件替换

This commit is contained in:
2025-11-04 19:01:11 +08:00
parent cff6b78c30
commit 4a1c15747c
4 changed files with 120 additions and 54 deletions

View File

@@ -51,7 +51,7 @@ fun GroupChatInfoScreen(groupId: String) {
val navController = LocalNavController.current
val context = LocalContext.current
val AppColors = LocalAppTheme.current
val viewModel = viewModel<GroupChatInfoViewModel>(
key = "GroupChatInfoViewModel_$groupId",
factory = object : ViewModelProvider.Factory {
@@ -60,12 +60,12 @@ fun GroupChatInfoScreen(groupId: String) {
}
}
)
var showAddMemoryDialog by remember { mutableStateOf(false) }
var showMemoryManageDialog by remember { mutableStateOf(false) }
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
val memoryManageSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
Column(
modifier = Modifier
.fillMaxSize()
@@ -99,17 +99,16 @@ fun GroupChatInfoScreen(groupId: String) {
Text(
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Start,
text = "群聊信息",
text = stringResource(R.string.group_chat_info_title),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 16.sp,
fontWeight = FontWeight.Bold
)
)
}
}
// 内容区域
LazyColumn(
modifier = Modifier.fillMaxSize(),
@@ -147,11 +146,11 @@ fun GroupChatInfoScreen(groupId: String) {
)
}
}
Spacer(modifier = Modifier.height(8.dp))
Text(
text = viewModel.groupInfo?.groupName ?: "_feiye,Rita 米小离儿",
text = viewModel.groupInfo?.groupName ?: "",
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 16.sp,
@@ -177,7 +176,7 @@ fun GroupChatInfoScreen(groupId: String) {
}
}
}
// 操作按钮
item {
Spacer(modifier = Modifier.height(10.dp))
@@ -208,14 +207,14 @@ fun GroupChatInfoScreen(groupId: String) {
}
Spacer(modifier = Modifier.height(5.dp))
Text(
text = "添加成员",
text = stringResource(R.string.group_chat_info_add_member),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 11.sp
)
)
}
// 通知设置
Column(
horizontalAlignment = Alignment.CenterHorizontally,
@@ -245,14 +244,14 @@ fun GroupChatInfoScreen(groupId: String) {
}
Spacer(modifier = Modifier.height(5.dp))
Text(
text = "通知",
text = stringResource(R.string.group_chat_info_notification),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 11.sp
)
)
}
// 退出群聊
Column(
horizontalAlignment = Alignment.CenterHorizontally,
@@ -275,7 +274,7 @@ fun GroupChatInfoScreen(groupId: String) {
}
Spacer(modifier = Modifier.height(5.dp))
Text(
text = "分享",
text = stringResource(R.string.group_chat_info_share),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 11.sp
@@ -297,7 +296,7 @@ fun GroupChatInfoScreen(groupId: String) {
contentAlignment = Alignment.CenterStart
) {
Text(
text = "解锁群扩展",
text = stringResource(R.string.group_chat_info_unlock_extension),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.main,
fontSize = 12.sp,
@@ -327,7 +326,7 @@ fun GroupChatInfoScreen(groupId: String) {
Spacer(modifier = Modifier.width(6.dp))
Column(modifier = Modifier.weight(1f)) {
Text(
text = "群记忆",
text = stringResource(R.string.group_chat_info_group_memory),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 15.sp,
@@ -336,7 +335,7 @@ fun GroupChatInfoScreen(groupId: String) {
)
Spacer(modifier = Modifier.height(2.dp))
Text(
text = "AI 会根据记忆在群聊里更懂你",
text = stringResource(R.string.group_chat_info_memory_description),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text.copy(alpha = 0.6f),
fontSize = 11.sp
@@ -361,7 +360,7 @@ fun GroupChatInfoScreen(groupId: String) {
contentAlignment = Alignment.Center
) {
Text(
text = "添加记忆",
text = stringResource(R.string.group_chat_info_add_memory),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 13.sp
@@ -380,7 +379,7 @@ fun GroupChatInfoScreen(groupId: String) {
contentAlignment = Alignment.Center
) {
Text(
text = "记忆管理",
text = stringResource(R.string.group_chat_info_memory_manage),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 13.sp
@@ -394,7 +393,7 @@ fun GroupChatInfoScreen(groupId: String) {
// 设置选项
item {
Spacer(modifier = Modifier.height(13.dp))
// 设置聊天主题
Row(
modifier = Modifier
@@ -415,7 +414,7 @@ fun GroupChatInfoScreen(groupId: String) {
)
Spacer(modifier = Modifier.width(10.dp))
Text(
text = "群资料设置",
text = stringResource(R.string.group_chat_info_group_settings),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 15.sp
@@ -428,7 +427,7 @@ fun GroupChatInfoScreen(groupId: String) {
contentDescription = null,
)
}
// 群可见性
Row(
modifier = Modifier
@@ -447,7 +446,7 @@ fun GroupChatInfoScreen(groupId: String) {
)
Spacer(modifier = Modifier.width(10.dp))
Text(
text = "群可见性",
text = stringResource(R.string.group_chat_info_group_visibility),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 15.sp
@@ -455,7 +454,7 @@ fun GroupChatInfoScreen(groupId: String) {
modifier = Modifier.weight(1f)
)
Text(
text = "待解锁",
text = stringResource(R.string.group_chat_info_locked),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text.copy(alpha = 0.5f),
fontSize = 11.sp
@@ -488,7 +487,7 @@ fun GroupChatInfoScreen(groupId: String) {
)
Spacer(modifier = Modifier.width(10.dp))
Text(
text = "成员管理",
text = stringResource(R.string.group_chat_info_member_manage),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 15.sp
@@ -519,7 +518,7 @@ fun GroupChatInfoScreen(groupId: String) {
)
Spacer(modifier = Modifier.width(10.dp))
Text(
text = "群聊壁纸",
text = stringResource(R.string.group_chat_info_wallpaper),
style = androidx.compose.ui.text.TextStyle(
color = AppColors.text,
fontSize = 15.sp
@@ -549,7 +548,7 @@ fun GroupChatInfoScreen(groupId: String) {
)
Spacer(modifier = Modifier.width(10.dp))
Text(
text = "解散群聊",
text = stringResource(R.string.group_chat_info_dissolve),
style = androidx.compose.ui.text.TextStyle(
color = Color(0xFFFF3B30),
fontSize = 15.sp
@@ -566,7 +565,7 @@ fun GroupChatInfoScreen(groupId: String) {
}
}
}
// 添加群记忆弹窗
if (showAddMemoryDialog) {
ModalBottomSheet(
@@ -597,7 +596,7 @@ fun GroupChatInfoScreen(groupId: String) {
)
}
}
// 记忆管理弹窗
if (showMemoryManageDialog) {
ModalBottomSheet(
@@ -642,7 +641,7 @@ fun AddGroupMemoryDialog(
val context = LocalContext.current
var memoryText by remember { mutableStateOf("") }
val maxLength = 500
// 监听添加记忆的结果
LaunchedEffect(viewModel.addMemorySuccess) {
if (viewModel.addMemorySuccess) {
@@ -652,14 +651,14 @@ fun AddGroupMemoryDialog(
viewModel.addMemorySuccess = false
}
}
LaunchedEffect(viewModel.addMemoryError) {
viewModel.addMemoryError?.let { error ->
android.widget.Toast.makeText(context, error, android.widget.Toast.LENGTH_SHORT).show()
viewModel.addMemoryError = null
}
}
Column(
modifier = Modifier
.fillMaxWidth()
@@ -677,7 +676,7 @@ fun AddGroupMemoryDialog(
) {
Spacer(modifier = Modifier.width(24.dp))
Text(
text = "添加群记忆",
text = stringResource(R.string.group_chat_info_add_group_memory),
style = TextStyle(
fontSize = 17.sp,
fontWeight = FontWeight.SemiBold,
@@ -695,9 +694,9 @@ fun AddGroupMemoryDialog(
colorFilter = ColorFilter.tint(Color.Black)
)
}
Spacer(modifier = Modifier.height(10.dp))
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
@@ -740,7 +739,7 @@ fun AddGroupMemoryDialog(
)
}
}
Column(
modifier = Modifier.weight(1f),
verticalArrangement = Arrangement.spacedBy(4.dp)
@@ -754,7 +753,7 @@ fun AddGroupMemoryDialog(
)
)
Text(
text = "${groupInfo?.memberCount ?: 32} 位成员",
text = stringResource(R.string.group_chat_info_member_count, groupInfo?.memberCount ?: 32),
style = TextStyle(
fontSize = 12.sp,
color = Color(0xFF3C3C43).copy(alpha = 0.6f)
@@ -762,7 +761,7 @@ fun AddGroupMemoryDialog(
)
}
}
// 输入框卡片
Box(
modifier = Modifier
@@ -804,7 +803,7 @@ fun AddGroupMemoryDialog(
innerTextField()
if (memoryText.isEmpty()) {
Text(
text = "这里的内容超过输入框自动换行",
text = stringResource(R.string.group_chat_info_memory_input_hint),
style = TextStyle(
fontSize = 15.sp,
color = Color.Black.copy(alpha = 0.3f)
@@ -829,7 +828,7 @@ fun AddGroupMemoryDialog(
}
}
}
// 提示信息卡片
Column(
modifier = Modifier
@@ -848,7 +847,7 @@ fun AddGroupMemoryDialog(
fontSize = 13.sp
)
Text(
text = "添加记忆需消耗 20 派币",
text = stringResource(R.string.group_chat_info_memory_cost),
style = TextStyle(
fontSize = 13.sp,
color = Color.Black
@@ -864,7 +863,7 @@ fun AddGroupMemoryDialog(
fontSize = 13.sp
)
Text(
text = "AI 将基于记忆优化回复",
text = stringResource(R.string.group_chat_info_memory_optimization),
style = TextStyle(
fontSize = 13.sp,
color = Color.Black
@@ -880,7 +879,7 @@ fun AddGroupMemoryDialog(
fontSize = 13.sp
)
Text(
text = "可随时编辑或删除",
text = stringResource(R.string.group_chat_info_memory_editable),
style = TextStyle(
fontSize = 13.sp,
color = Color.Black
@@ -888,7 +887,7 @@ fun AddGroupMemoryDialog(
)
}
}
// 添加记忆按钮
Box(
modifier = Modifier
@@ -918,7 +917,7 @@ fun AddGroupMemoryDialog(
)
} else {
Text(
text = "添加记忆",
text = stringResource(R.string.group_chat_info_add_memory),
style = TextStyle(
fontSize = 17.sp,
color = Color.White