Skip to content

Instantly share code, notes, and snippets.

@agammahajan1
Created March 25, 2022 12: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 agammahajan1/358111a3c22c6961dfc52edd89ef0c24 to your computer and use it in GitHub Desktop.
Save agammahajan1/358111a3c22c6961dfc52edd89ef0c24 to your computer and use it in GitHub Desktop.
@Composable
fun ApplyButton(
text: String,
modifier: Modifier = Modifier,
applicable: Boolean = false,
spanStyle: SpanStyle,
paragraphStyle: ParagraphStyle,
style: TextStyle,
onClick: () -> Unit
) {
ClickableText(
text = AnnotatedString(
text = text,
spanStyle = spanStyle,
paragraphStyle = paragraphStyle
),
onClick = {
if (applicable) {
onClick.invoke()
}
},
modifier = modifier,
style = style
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment