From 0937c4ec450765792a18fbf16843f14e1e16c6a1 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 20 Nov 2023 18:06:32 +0100 Subject: [PATCH] Make onComplete a proper callback --- .../java/eu/steffo/twom/ui/login/LoginActivityControl.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/steffo/twom/ui/login/LoginActivityControl.kt b/app/src/main/java/eu/steffo/twom/ui/login/LoginActivityControl.kt index 644a856..4ef33fa 100644 --- a/app/src/main/java/eu/steffo/twom/ui/login/LoginActivityControl.kt +++ b/app/src/main/java/eu/steffo/twom/ui/login/LoginActivityControl.kt @@ -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))