Skip to content

Instantly share code, notes, and snippets.

View rodrigomartind's full-sized avatar
🏠
Working from home

Rodrigo Dominguez rodrigomartind

🏠
Working from home
View GitHub Profile
@rodrigomartind
rodrigomartind / BasicInfiniteCompose.kt
Created June 6, 2023 21:35
The Art of Small Animations in Android with Jetpack Compose
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.foundation.layout.Box
@rodrigomartind
rodrigomartind / SmallDesignToolCompose.kt
Created April 14, 2023 18:53
Small Design Tool in Jetpack Compose
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import android.annotation.SuppressLint
import androidx.compose.animation.animateColor
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationVector1D
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.foundation.Image
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.fillMaxSize
@rodrigomartind
rodrigomartind / AnimationBlurEffect.kt
Created December 30, 2022 20:04
Animation Blur Effect in Jetpack Compose
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
@rodrigomartind
rodrigomartind / ImageVectorAnimationStepByStep.MD
Last active January 30, 2023 01:50
Animating ImageVector in JetpackCompose

Step by step of ImageVector animation in Jetpack Compose

Step 1

screen-recording-1671473917341.mp4

Step 1

screen-recording-1671473945880.mp4

Step 3

screen-recording-1671473974142.mp4
import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.helper.widget.Carousel
class ActivityMotionCarouselDemo : AppCompatActivity() {
var colors = intArrayOf(
Color.parseColor("#e57373"),
Color.parseColor("#ce93d8"),
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
...
<Transition
android:id="@+id/detailTransition"
app:constraintSetEnd="@+id/detailCard"
app:constraintSetStart="@id/start"
app:duration="1000">
<OnSwipe
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
...
<Transition
android:id="@+id/detailTransition"
app:constraintSetEnd="@+id/detailCard"
app:constraintSetStart="@id/start"
app:duration="1000">
<OnSwipe