0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-25 20:55:12 +00:00

T H I C C progressbar

This commit is contained in:
X1nto 2021-06-28 19:28:36 +04:00
parent aa3234a83c
commit 493b6d3963
2 changed files with 8 additions and 2 deletions

View file

@ -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(

View file

@ -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"
)
}
}