Added API Key dialog logic
This commit is contained in:
parent
b7933fc5b0
commit
df40aa8455
1 changed files with 9 additions and 3 deletions
|
|
@ -100,7 +100,12 @@ fun HomeScreen(paddingValues: PaddingValues) {
|
||||||
Spacer(modifier = Modifier.width(12.dp))
|
Spacer(modifier = Modifier.width(12.dp))
|
||||||
AnimatedVisibility(currentScreen == "passwordDialog") {
|
AnimatedVisibility(currentScreen == "passwordDialog") {
|
||||||
OutlinedButton (
|
OutlinedButton (
|
||||||
onClick = {},
|
onClick = {
|
||||||
|
when(currentScreen) {
|
||||||
|
"passwordDialog" -> {currentScreen = "apiDialog"}
|
||||||
|
"apidialog" -> {currentScreen = "passwordDialog"}
|
||||||
|
}
|
||||||
|
},
|
||||||
modifier = Modifier.padding(top = 24.dp)
|
modifier = Modifier.padding(top = 24.dp)
|
||||||
) {
|
) {
|
||||||
Row() {
|
Row() {
|
||||||
|
|
@ -229,11 +234,11 @@ fun PasswordDialog(username: String, password: String, updateUsername: (newUsern
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ApiDialog(apiKey: String, updateApiKey: (newApiKey: String) -> Unit) {
|
fun ApiDialog(apiKey: String, updateApiKey: (newApiKey: String) -> Unit) {
|
||||||
var dialogApiKey by remember { mutableStateOf("") }
|
var dialogApiKey by remember { mutableStateOf(apiKey) }
|
||||||
Column {
|
Column {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
label = { Text(text = "Password") },
|
label = { Text(text = "API Key") },
|
||||||
textStyle = MaterialTheme.typography.bodySmall,
|
textStyle = MaterialTheme.typography.bodySmall,
|
||||||
value = dialogApiKey,
|
value = dialogApiKey,
|
||||||
onValueChange = { text ->
|
onValueChange = { text ->
|
||||||
|
|
@ -245,6 +250,7 @@ fun ApiDialog(apiKey: String, updateApiKey: (newApiKey: String) -> Unit) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun LoadingDialog () {
|
fun LoadingDialog () {
|
||||||
CircularWavyProgressIndicator()
|
CircularWavyProgressIndicator()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue