Added API Key dialog logic

This commit is contained in:
Leandro Schaguhn 2025-06-13 13:42:04 +02:00
parent b7933fc5b0
commit df40aa8455

View file

@ -100,7 +100,12 @@ fun HomeScreen(paddingValues: PaddingValues) {
Spacer(modifier = Modifier.width(12.dp))
AnimatedVisibility(currentScreen == "passwordDialog") {
OutlinedButton (
onClick = {},
onClick = {
when(currentScreen) {
"passwordDialog" -> {currentScreen = "apiDialog"}
"apidialog" -> {currentScreen = "passwordDialog"}
}
},
modifier = Modifier.padding(top = 24.dp)
) {
Row() {
@ -229,11 +234,11 @@ fun PasswordDialog(username: String, password: String, updateUsername: (newUsern
@Composable
fun ApiDialog(apiKey: String, updateApiKey: (newApiKey: String) -> Unit) {
var dialogApiKey by remember { mutableStateOf("") }
var dialogApiKey by remember { mutableStateOf(apiKey) }
Column {
OutlinedTextField(
modifier = Modifier.fillMaxWidth(),
label = { Text(text = "Password") },
label = { Text(text = "API Key") },
textStyle = MaterialTheme.typography.bodySmall,
value = dialogApiKey,
onValueChange = { text ->
@ -245,6 +250,7 @@ fun ApiDialog(apiKey: String, updateApiKey: (newApiKey: String) -> Unit) {
}
}
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun LoadingDialog () {
CircularWavyProgressIndicator()