Last active
September 10, 2021 22:53
-
-
Save carterhudson/1369f319d68bfe504179a8ffecc1ee03 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
@Preview | |
@Composable | |
fun CustomRepeatingButton() { | |
Box(modifier = Modifier.fillMaxSize()) { | |
var repeatCount by remember { mutableStateOf(0) } | |
val interactionSource = remember { MutableInteractionSource() } | |
Surface( | |
modifier = Modifier | |
.repeatingClickable( | |
interactionSource = interactionSource, | |
enabled = true, | |
onClick = { | |
repeatCount++ | |
} | |
) | |
.align(Alignment.Center) | |
) { | |
Row { | |
Text( | |
modifier = Modifier.padding(6.dp), | |
text = "Repeat Count: $repeatCount" | |
) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment