maximus
06/10/2025, 12:36 PMmaximus
06/10/2025, 12:56 PMStefan Oltmann
06/10/2025, 2:30 PMKonstantin Tskhovrebov
06/10/2025, 2:45 PMmaximus
06/10/2025, 2:49 PMmaximus
06/10/2025, 2:50 PMKonstantin Tskhovrebov
06/10/2025, 2:55 PMKonstantin Tskhovrebov
06/10/2025, 2:55 PMimport androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.TransformOrigin
import com.nomanr.animate.compose.core.AnimationPreset
import com.nomanr.animate.compose.core.Keyframe
import com.nomanr.animate.compose.core.TransformProperties
import com.nomanr.animate.compose.core.animateKeyframe
class UntitledPreset : AnimationPreset {
private val keyframes = listOf(
Keyframe.Segment(
start = 0f,
end = 0.3f,
from = TransformProperties(
translationX = -700f,
alpha = 0f
),
to = TransformProperties(
translationX = 0f,
alpha = 1f
)),
Keyframe.Segment(
start = 0.12931977212429047f,
end = 0.7000000476837158f,
from = TransformProperties(
translationX = 0f,
rotationY = 0f,
alpha = 1f
),
to = TransformProperties(
translationX = 0f,
rotationY = 360f,
alpha = 1f
)),
Keyframe.Segment(
start = 0.7f,
end = 1f,
from = TransformProperties(
translationX = 0f,
alpha = 1f
),
to = TransformProperties(
translationX = 700f,
alpha = 0f
))
)
@Composable
override fun animate(progress: State<Float>): Modifier =
Modifier.animateKeyframe(
progress = progress,
keyframes = keyframes,
transformOrigin = TransformOrigin.Center
)
}
maximus
06/10/2025, 2:59 PMKonstantin Tskhovrebov
06/10/2025, 3:02 PMmaximus
06/10/2025, 3:05 PM