Update linked devices screen.

This commit is contained in:
Michelle Tang
2024-06-05 17:17:03 -07:00
committed by Alex Hart
parent 5c181e774f
commit ac52b5b992
21 changed files with 911 additions and 11 deletions
@@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
@@ -128,6 +129,33 @@ object Dialogs {
)
}
/**
* Customizable progress spinner that shows [message] below the spinner to let users know
* an action is completing
*/
@Composable
fun IndeterminateProgressDialog(message: String) {
androidx.compose.material3.AlertDialog(
onDismissRequest = {},
confirmButton = {},
dismissButton = {},
text = {
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth().fillMaxHeight()
) {
Spacer(modifier = Modifier.size(24.dp))
CircularProgressIndicator()
Spacer(modifier = Modifier.size(20.dp))
Text(message)
}
},
modifier = Modifier
.size(200.dp)
)
}
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun PermissionRationaleDialog(
@@ -237,3 +265,9 @@ private fun MessageDialogPreview() {
private fun IndeterminateProgressDialogPreview() {
Dialogs.IndeterminateProgressDialog()
}
@Preview
@Composable
private fun IndeterminateProgressDialogMessagePreview() {
Dialogs.IndeterminateProgressDialog("Completing...")
}