Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌟 add int state sample and refactor sample package
- Loading branch information
1 parent
7553f3e
commit b0f6b7c
Showing
6 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...composeanimationplayground/ui/screen/animation/animateproperty/AnimateColorAsStateDemo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...64/composeanimationplayground/ui/screen/animation/animateproperty/AnimateDpAsStateDemo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...composeanimationplayground/ui/screen/animation/animateproperty/AnimateFloatAsStateDemo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...4/composeanimationplayground/ui/screen/animation/animateproperty/AnimateIntAsStateDemo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.theapache64.composeanimationplayground.ui.screen.animation.animateproperty | ||
|
||
import androidx.compose.animation.core.animateIntAsState | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.theapache64.composeanimationplayground.ui.composable.TeslaLogo | ||
|
||
@Composable | ||
fun AnimateIntAsStateDemo( | ||
isActive: Boolean | ||
) { | ||
val targetInt = if (isActive) 50 else 100 | ||
val animatedInt by animateIntAsState(targetValue = targetInt) | ||
|
||
TeslaLogo( | ||
modifier = Modifier.size(animatedInt.dp) | ||
) | ||
} |
2 changes: 1 addition & 1 deletion
2
...omposeanimationplayground/ui/screen/animation/animateproperty/AnimateOffsetAsStateDemo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters