Skip to content

Instantly share code, notes, and snippets.

@sergenes
Last active January 3, 2022 09:57
Show Gist options
  • Select an option

  • Save sergenes/d3eafb3b97d49d023d19edc00b6835c3 to your computer and use it in GitHub Desktop.

Select an option

Save sergenes/d3eafb3b97d49d023d19edc00b6835c3 to your computer and use it in GitHub Desktop.
@Preview
@Composable
fun TestNiceButton() {
NiceButton(title = "Test Button") { }
}
Composable
fun NiceButton(
title: String,
textColor: Color = primaryTextColor,
backgroundColor: Color = primaryColor,
onClick: () -> Unit
) {
Button(
onClick = onClick,
modifier = Modifier
.padding(smallSpace)
.height(normalTouchableHeight),
shape = RoundedCornerShape(30),
colors = ButtonDefaults.outlinedButtonColors(
contentColor = textColor,
backgroundColor = backgroundColor
)
) {
Text(title)
}
}
@ppareit
Copy link

ppareit commented Jan 3, 2022

at line 7, use @Composable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment