Revert "Фикс: кнопка Install Update растягивалась на весь экран"
This reverts commit 200d6987eb.
This commit is contained in:
@@ -1289,7 +1289,7 @@ fun ChatsListScreen(
|
||||
}
|
||||
|
||||
if (showUpdateBanner) {
|
||||
Row(
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(50.dp)
|
||||
@@ -1311,53 +1311,60 @@ fun ChatsListScreen(
|
||||
UpdateManager.downloadAndInstall(context)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
.padding(horizontal = 16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
},
|
||||
contentAlignment = Alignment.CenterStart
|
||||
) {
|
||||
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) {
|
||||
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))
|
||||
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),
|
||||
text = when (curUpdate) {
|
||||
is UpdateState.Downloading ->
|
||||
"Downloading... ${curUpdate.progress}%"
|
||||
is UpdateState.ReadyToInstall ->
|
||||
"Install Update"
|
||||
is UpdateState.UpdateAvailable ->
|
||||
"Update Rosetta"
|
||||
else -> ""
|
||||
},
|
||||
color = Color.White,
|
||||
trackColor = Color.White.copy(alpha = 0.3f),
|
||||
strokeWidth = 2.dp
|
||||
fontSize = 15.sp,
|
||||
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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user