1
Fork 0
mirror of https://github.com/Steffo99/twom.git synced 2024-11-25 01:24:24 +00:00

Make onComplete a proper callback

This commit is contained in:
Steffo 2023-11-20 18:06:32 +01:00
parent c3760adff4
commit 0937c4ec45
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -23,7 +23,7 @@ import eu.steffo.twom.ui.BASE_PADDING
fun LoginActivityControl(
modifier: Modifier = Modifier,
onSelectHomeserver: () -> Unit = {},
onComplete: () -> Unit = {},
onComplete: (username: String, password: String) -> Unit = { _, _ -> },
) {
var username by rememberSaveable { mutableStateOf("") }
@ -77,7 +77,9 @@ fun LoginActivityControl(
Row(BASE_PADDING) {
Button(
modifier = Modifier.fillMaxWidth(),
onClick = onComplete,
onClick = {
onComplete(username, password)
},
enabled = false,
) {
Text(LocalContext.current.getString(R.string.login_complete_text))