From 493b6d3963b1ea2ed7a521c64dc8aa839c49c321 Mon Sep 17 00:00:00 2001 From: X1nto Date: Mon, 28 Jun 2021 19:28:36 +0400 Subject: [PATCH] T H I C C progressbar --- .../components/progressindicator/ManagerProgressIndicator.kt | 5 ++++- .../ui/widgets/home/download/AppDownloadDialogProgress.kt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/vanced/manager/ui/components/progressindicator/ManagerProgressIndicator.kt b/app/src/main/java/com/vanced/manager/ui/components/progressindicator/ManagerProgressIndicator.kt index 66716837..f3a492c6 100644 --- a/app/src/main/java/com/vanced/manager/ui/components/progressindicator/ManagerProgressIndicator.kt +++ b/app/src/main/java/com/vanced/manager/ui/components/progressindicator/ManagerProgressIndicator.kt @@ -2,6 +2,7 @@ package com.vanced.manager.ui.components.progressindicator import androidx.compose.animation.core.animateFloatAsState import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.material.LinearProgressIndicator import androidx.compose.material.MaterialTheme import androidx.compose.material.ProgressIndicatorDefaults @@ -10,17 +11,19 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.composed import androidx.compose.ui.draw.clip +import androidx.compose.ui.unit.dp import com.vanced.manager.ui.components.color.managerAccentColor private val progressBarModifier = Modifier.composed { then( + height(5.dp) + ).then( fillMaxWidth() ).then( clip(MaterialTheme.shapes.medium) ) } - @Composable fun ManagerProgressIndicator() { LinearProgressIndicator( diff --git a/app/src/main/java/com/vanced/manager/ui/widgets/home/download/AppDownloadDialogProgress.kt b/app/src/main/java/com/vanced/manager/ui/widgets/home/download/AppDownloadDialogProgress.kt index 06a20870..1d595760 100644 --- a/app/src/main/java/com/vanced/manager/ui/widgets/home/download/AppDownloadDialogProgress.kt +++ b/app/src/main/java/com/vanced/manager/ui/widgets/home/download/AppDownloadDialogProgress.kt @@ -1,9 +1,11 @@ package com.vanced.manager.ui.widgets.home.download +import androidx.compose.animation.core.animateIntAsState import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.wrapContentWidth import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import com.vanced.manager.R @@ -20,6 +22,7 @@ fun AppDownloadDialogProgress( true -> ManagerProgressIndicator() false -> ManagerProgressIndicator(progress = progress) } + val animatedProgress by animateIntAsState(targetValue = progress.toInt()) Row { Text( modifier = Modifier @@ -34,7 +37,7 @@ fun AppDownloadDialogProgress( modifier = Modifier .weight(1f) .wrapContentWidth(Alignment.End), - text = "%$progress" + text = "%$animatedProgress" ) } } \ No newline at end of file