Skip to content

Instantly share code, notes, and snippets.

@Peddro

Peddro/Button.kt Secret

Created January 26, 2022 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Peddro/d279fb312fb1c2889e6e8a39a4e1941b to your computer and use it in GitHub Desktop.
Save Peddro/d279fb312fb1c2889e6e8a39a4e1941b to your computer and use it in GitHub Desktop.
@Composable
fun H19Button(
modifier: Modifier = Modifier,
enabled: Boolean = true,
shape: Shape = H19Theme.shapes.small,
backgroundColor : Color = H19Theme.colors.primary,
contentColor : Color = Color.White,
elevation: ButtonElevation = ButtonDefaults.elevation(defaultElevation = 0.dp),
colors: ButtonColors = ButtonDefaults.buttonColors(
backgroundColor = backgroundColor,
contentColor = contentColor,
disabledBackgroundColor = backgroundColor.copy(alpha = 0.20f),
disabledContentColor = contentColor
),
text: String,
onClick: () -> Unit
) {
Button(
modifier = modifier,
onClick = onClick,
enabled = enabled,
shape = shape,
elevation = elevation,
colors = colors
) {
Text(text = text, color = contentColor)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment