md3e + loading indicator
This commit is contained in:
parent
74b0d534a0
commit
b7933fc5b0
2 changed files with 12 additions and 2 deletions
|
|
@ -33,6 +33,7 @@ android {
|
|||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
freeCompilerArgs += "-opt-in=androidx.compose.material3.ExperimentalMaterial3ExpressiveApi"
|
||||
}
|
||||
buildFeatures {
|
||||
compose = true
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.width
|
|||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.CircularWavyProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
|
|
@ -47,6 +48,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
|
||||
@Composable
|
||||
|
|
@ -78,6 +80,7 @@ fun HomeScreen(paddingValues: PaddingValues) {
|
|||
"serverDialog" -> ServerDialog(serverURL, {newServerURL -> serverURL = newServerURL })
|
||||
"passwordDialog" -> PasswordDialog(username, password, {newUsername -> username = newUsername}, {newPassword -> password = newPassword })
|
||||
"apiDialog" -> ApiDialog(apiKey) {newApiKey -> apiKey = newApiKey}
|
||||
"loadingDialog" -> LoadingDialog()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -112,8 +115,9 @@ fun HomeScreen(paddingValues: PaddingValues) {
|
|||
Button(
|
||||
onClick = {when(currentScreen) {
|
||||
"serverDialog" -> currentScreen = "passwordDialog"
|
||||
"passwordDialog" -> currentScreen = "LoadingDialog"
|
||||
"apiDialog" -> currentScreen = "LoadingDialog"
|
||||
"passwordDialog" -> currentScreen = "loadingDialog"
|
||||
"apiDialog" -> currentScreen = "loadingDialog"
|
||||
"loadingDialog" -> currentScreen = "loadingDialog"
|
||||
}},
|
||||
modifier = Modifier.padding(top = 24.dp)
|
||||
.fillMaxWidth()
|
||||
|
|
@ -240,3 +244,8 @@ fun ApiDialog(apiKey: String, updateApiKey: (newApiKey: String) -> Unit) {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun LoadingDialog () {
|
||||
CircularWavyProgressIndicator()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue