-
-
Save GerardPaligot/d877f25ef99e44167b37c899392d71fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun ProfileInput( | |
profile: UserProfileUi, | |
modifier: Modifier = Modifier | |
) { | |
Scaffold(modifier = modifier) { | |
// Require to go at the next input from the keyboard. | |
val focusManager = LocalFocusManager.current | |
LazyColumn { | |
if (profile.qrCode != null) { | |
item { | |
Image(bitmap = profile.qrCode!!.asImageBitmap()) | |
} | |
} | |
item { | |
TextField( | |
value = profile.email, | |
label = { Text("Your email address*") }, | |
keyboardOptions = KeyboardOptions( | |
imeAction = ImeAction.Next, | |
keyboardType = KeyboardType.Email | |
) | |
) | |
} | |
item { | |
TextField( | |
value = profile.firstName, | |
label = { Text("Your first name*") }, | |
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Next) | |
) | |
} | |
item { | |
TextField( | |
value = profile.lastName, | |
label = { Text("Your last name*") }, | |
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Next) | |
) | |
} | |
item { | |
TextField( | |
value = profile.company, | |
label = { Text("Your company") }, | |
keyboardActions = KeyboardActions(onDone = { | |
focusManager.clearFocus() | |
}), | |
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done) | |
) | |
} | |
item { | |
Button( | |
onClick = { | |
focusManager.clearFocus() | |
} | |
) { | |
Text("Generate your QR code") | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment