Skip to content

Instantly share code, notes, and snippets.

@ilyasipek
ilyasipek / compose_snippets.xml
Last active March 2, 2025 18:46
a collection of compose live-templates
<template name="col" value="androidx.compose.foundation.layout.Column($MODIFIER$) {&#10; $END$&#10;}" description="Creates a Column" toReformat="true" toShortenFQNames="true">
<variable name="MODIFIER" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="KOTLIN" value="true" />
<option name="KOTLIN_COMMENT" value="false" />
</context>
</template>
<template name="rmfs" value="androidx.compose.runtime.remember {&#10; androidx.compose.runtime.mutableFloatStateOf($INITIAL_VALUE$)&#10;}&#10;$END$" description="remembers a mutable float state" toReformat="true" toShortenFQNames="true">
<variable name="INITIAL_VALUE" expression="" defaultValue="" alwaysStopAt="true" />
<context>
@ilyasipek
ilyasipek / CounterAnimationRow.kt
Created January 18, 2024 18:20
CounterAnimationRow
@Composable
fun CounterAnimationRow(
count: Int,
modifier: Modifier = Modifier,
charComposable: @Composable RowScope.(Char) -> Unit,
) {
var oldCount by remember { mutableIntStateOf(count) }
val increasingValueContentTransform = remember {
slideInVertically { -it } + fadeIn() togetherWith slideOutVertically { it } + fadeOut()
}