Skip to content

Instantly share code, notes, and snippets.

@tamtom
Created January 2, 2022 10:44
Show Gist options
  • Save tamtom/994dba813761987c5b04002b01720501 to your computer and use it in GitHub Desktop.
Save tamtom/994dba813761987c5b04002b01720501 to your computer and use it in GitHub Desktop.
@Composable
fun LoginScreen //....
//....
Button(
onClick = {
action.invoke(Login)
}, modifier = Modifier
.fillMaxWidth()
.padding(top = 32.dp)
.defaultMinSize(minHeight = 48.dp)
) {
if (loginState.isLoading) {
CircularProgressIndicator(
color = MaterialTheme.colors.onPrimary, modifier = Modifier.size(24.dp, 24.dp),
strokeWidth = 2.dp
)
} else {
Text(text = stringResource(string.login))
}
}
if(loginState.isSuccess) {
navigateToHome()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment