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

This reverts commit 200d6987eb.
This commit is contained in:
2026-03-17 18:14:55 +07:00
parent 200d6987eb
commit a3fdc9559b

View File

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