A little animation to show progressbar only when needed

This commit is contained in:
Iamlooker 2022-04-10 17:52:08 +05:30
parent 00f6822cc5
commit 09045d479c

View File

@ -1,5 +1,6 @@
package com.looker.droidify.ui.compose.pages.app_detail.components
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
@ -48,9 +49,13 @@ fun Header(
appSize = appSize,
appDev = appDev
)
DownloadProgress(totalSize = 69420)
var buttonState by remember { mutableStateOf<ButtonStates>(Connecting) }
AnimatedVisibility(visible = buttonState is Cancelable) {
DownloadProgress(totalSize = 69420)
}
InstallButton(buttonState = buttonState) {
buttonState = when (it) {
Connecting -> Download