fix(sub2api): 刷新按钮与「面板管理」标题同排
- 弹窗标题槽改为 Row:左侧标题 + 右侧刷新图标按钮,刷新与标题处于同一水平线, 且随标题固定不随内容滚动(内容区仍可滚动)。 - showHeader=false 时组件不再渲染内部标题/刷新行,避免多出一条空行把刷新挤到标题下面。 真机验证(V2172A / Android 15):标题 y284..413 与刷新 y300..396 同行居中; 点刷新弹窗保持打开且列表重载;滚动后标题+刷新固定于顶部。 compileDebugKotlin 与 lintDebug 均通过。
This commit is contained in:
parent
eebe9f6987
commit
ce8a656448
@ -384,7 +384,22 @@ fun DashboardScreen(
|
||||
val maxDialogHeight = (LocalConfiguration.current.screenHeightDp * 0.72f).dp
|
||||
AlertDialog(
|
||||
onDismissRequest = { showSub2PanelManagement = false },
|
||||
title = { Text(stringResource(R.string.sub2_panel_manage_title), fontWeight = FontWeight.Bold) },
|
||||
// 标题与刷新按钮同一行:刷新重新拉取 Key 列表与分组
|
||||
title = {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
||||
Text(
|
||||
text = stringResource(R.string.sub2_panel_manage_title),
|
||||
fontWeight = FontWeight.Bold,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
IconButton(onClick = { viewModel.loadPanelKeys(); viewModel.loadPanelGroups() }) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Refresh,
|
||||
contentDescription = stringResource(R.string.action_refresh)
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
text = {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
|
||||
@ -124,15 +124,10 @@ internal fun Sub2ApiPanelManagement(
|
||||
Icon(Icons.Filled.Refresh, contentDescription = stringResource(R.string.action_refresh))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 标题由外部弹窗提供时,这里保留一个刷新按钮,方便手动重新拉取 Key/分组
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
IconButton(onClick = { onLoadKeys(); onLoadGroups() }) {
|
||||
Icon(Icons.Filled.Refresh, contentDescription = stringResource(R.string.action_refresh))
|
||||
}
|
||||
}
|
||||
}
|
||||
// showHeader=false 时不渲染任何标题/刷新行:
|
||||
// 弹窗场景由调用方把标题与刷新按钮放在同一行(见 DashboardScreen 的 title 槽),
|
||||
// 这里再放一行会让刷新按钮掉到标题下面,视觉上多出一条空行。
|
||||
|
||||
(actionMessage ?: lastResult)?.let { msg ->
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user