UpdateDialogue.kt
This commit is contained in:
@@ -16,7 +16,7 @@ android {
|
||||
targetSdk = 34
|
||||
versionCode = 4
|
||||
|
||||
versionName = "3.0.9"
|
||||
versionName = "3.1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
||||
@@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
@@ -77,8 +76,13 @@ fun UpdateDialog(
|
||||
fontFamily = FontFamily.Monospace
|
||||
)
|
||||
if (downloadProgress > 0f) {
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
LinearProgressIndicator(progress = downloadProgress)
|
||||
Row (verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Center){
|
||||
LinearProgressIndicator(progress = downloadProgress , modifier = Modifier.fillMaxWidth(0.8f))
|
||||
Text(text = " ${floatToProgress(downloadProgress)}%")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -97,7 +101,7 @@ fun UpdateDialog(
|
||||
CircularProgressIndicator(color = MaterialTheme.colorScheme.surface)
|
||||
}
|
||||
Text(
|
||||
text = if (downloadProgress > 0f && downloadProgress <1f) "Downloading..." else "Install",
|
||||
text = if (downloadProgress > 0f && downloadProgress <1f) "Downloading..." else if (downloadProgress == 1f && isinstallPressed.value) "ReInstall Again" else "Install",
|
||||
modifier = Modifier.padding(start = if(isinstallPressed.value && downloadProgress ==0f) 10.dp else 0.dp )
|
||||
)
|
||||
|
||||
@@ -114,3 +118,9 @@ fun UpdateDialog(
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun floatToProgress(float: Float): Int{
|
||||
return (float * 100f).toInt()
|
||||
}
|
||||
Reference in New Issue
Block a user