Skip to content

Instantly share code, notes, and snippets.

View yveskalume's full-sized avatar
🌍
Working from Anywhere

Yves Kalume yveskalume

🌍
Working from Anywhere
View GitHub Profile
@yveskalume
yveskalume / gist:469c3721ee43620d6e9eb76601b0caf4
Last active March 17, 2024 17:48
ButtonWithLongClick.kt
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun Button(
onClick: () -> Unit,
onLongClick: () -> Unit,
modifier: Modifier = Modifier,
shape: Shape = ButtonDefaults.shape,
containerColor: Color,
contentColor: Color,
border: BorderStroke? = null,
@yveskalume
yveskalume / TextFieldScreen.kt
Created March 17, 2024 22:02
Shake animation for text field on wrong value submission
@Composable
fun TextFieldScreen() {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically)
) {
val context = LocalContext.current
val (email, onEmailChange) = remember {