Fix Progressbar corner

This commit is contained in:
Iamlooker 2022-04-21 01:07:00 +05:30
parent 6192b734f9
commit 10e8485f20

View File

@ -4,10 +4,7 @@ import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.*
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -52,7 +49,7 @@ fun Header(
var buttonState by remember { mutableStateOf<ButtonStates>(Connecting) } var buttonState by remember { mutableStateOf<ButtonStates>(Connecting) }
AnimatedVisibility(visible = buttonState is Cancelable) { AnimatedVisibility(visible = buttonState is Cancelable) {
DownloadProgress(totalSize = 69420) DownloadProgress(modifier = Modifier.padding(horizontal = 12.dp), totalSize = 69420)
} }
InstallButton(buttonState = buttonState) { InstallButton(buttonState = buttonState) {
@ -167,6 +164,11 @@ fun DownloadProgress(
text = totalSize.times(downloading).toLong().formatSize() + "/" + totalSize.formatSize() text = totalSize.times(downloading).toLong().formatSize() + "/" + totalSize.formatSize()
) )
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
LinearProgressIndicator(modifier = Modifier.fillMaxWidth(), progress = downloading) LinearProgressIndicator(
modifier = Modifier
.fillMaxWidth()
.clip(Shapes.Full),
progress = downloading
)
} }
} }