Фикс: кнопка Install Update растягивалась на весь экран

Убран лишний Box-обёртка с contentAlignment вокруг Row — Row теперь
сам является кликабельным элементом с фиксированной height(50.dp).
Убран Spacer внутри Box который конфликтовал с измерением высоты.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 18:12:04 +07:00
parent c6c0ade1b3
commit 200d6987eb

View File

@@ -1289,7 +1289,7 @@ fun ChatsListScreen(
}
if (showUpdateBanner) {
Box(
Row(
modifier = Modifier
.fillMaxWidth()
.height(50.dp)
@@ -1311,60 +1311,53 @@ fun ChatsListScreen(
UpdateManager.downloadAndInstall(context)
else -> {}
}
},
contentAlignment = Alignment.CenterStart
}
.padding(horizontal = 16.dp),
verticalAlignment = Alignment.CenterVertically
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
imageVector = when (curUpdate) {
is UpdateState.Downloading -> TablerIcons.X
else -> TablerIcons.Download
},
contentDescription = null,
tint = Color.White,
modifier = Modifier.size(22.dp)
)
Spacer(modifier = Modifier.width(12.dp))
Icon(
imageVector = when (curUpdate) {
is UpdateState.Downloading -> TablerIcons.X
else -> TablerIcons.Download
},
contentDescription = null,
tint = Color.White,
modifier = Modifier.size(22.dp)
)
Spacer(modifier = Modifier.width(12.dp))
Text(
text = when (curUpdate) {
is UpdateState.Downloading ->
"Downloading... ${curUpdate.progress}%"
is UpdateState.ReadyToInstall ->
"Install Update"
is UpdateState.UpdateAvailable ->
"Update Rosetta"
else -> ""
},
color = Color.White,
fontSize = 15.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(1f)
)
if (curUpdate is UpdateState.UpdateAvailable) {
Text(
text = when (curUpdate) {
is UpdateState.Downloading ->
"Downloading... ${curUpdate.progress}%"
is UpdateState.ReadyToInstall ->
"Install Update"
is UpdateState.UpdateAvailable ->
"Update Rosetta"
else -> ""
},
color = Color.White,
fontSize = 15.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(1f)
text = curUpdate.version,
color = Color.White.copy(alpha = 0.8f),
fontSize = 13.sp,
fontWeight = FontWeight.Medium
)
}
if (curUpdate is UpdateState.Downloading) {
CircularProgressIndicator(
progress = curUpdate.progress / 100f,
modifier = Modifier.size(20.dp),
color = Color.White,
trackColor = Color.White.copy(alpha = 0.3f),
strokeWidth = 2.dp
)
if (curUpdate is UpdateState.UpdateAvailable) {
Text(
text = curUpdate.version,
color = Color.White.copy(alpha = 0.8f),
fontSize = 13.sp,
fontWeight = FontWeight.Medium
)
}
if (curUpdate is UpdateState.Downloading) {
CircularProgressIndicator(
progress = curUpdate.progress / 100f,
modifier = Modifier.size(20.dp),
color = Color.White,
trackColor = Color.White.copy(alpha = 0.3f),
strokeWidth = 2.dp
)
}
}
}
Spacer(modifier = Modifier.height(12.dp))
}
}
}