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
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
ColorPickerTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
@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 {
@c5inco
c5inco / ChainedSpring.kt
Last active March 17, 2024 17:32
Jetpack Compose implementation of inspiration: https://twitter.com/amos_gyamfi/status/1496487449735872526
package des.c5inco.material3
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.spring
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Surface