Skip to content

Commit feaf486

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 2617c6e + 442e7a6 commit feaf486

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Add Animatable Material Components in Android Jetpack Compose.
44

55
Create jetpack compose animations painless.
66

7+
What you can create from Material 3 components right now;
8+
* Text Animation
9+
* Box Animation
10+
* Card Animation
11+
* Icon Animation
12+
* and combinations
13+
714
## How it looks
815

916
<img src="https://user-images.githubusercontent.com/50905347/197984728-7bfe5536-b78e-41e1-91cb-5bc167e51850.gif" width="250" height="530">&nbsp;&nbsp;<img src="https://user-images.githubusercontent.com/50905347/198032696-f78f2b66-964c-494d-9614-14107ecde244.gif" width="250" height="530">
@@ -336,12 +343,12 @@ Box(
336343
<img src="https://user-images.githubusercontent.com/50905347/198940886-d2107020-4043-424a-85b2-dfeb7fccf41e.gif" width="250" height="530">
337344

338345
<details closed>
339-
<summary>State</summary>
346+
<summary>States</summary>
340347
<br>
341348

342349
343350
```kotlin
344-
// Simply create shared state and pass it to AnimatableCard and AnimatableText
351+
// Simply create card state and text state
345352
val animatableCardState = rememberAnimatableCardState(
346353
initialSize = DpSize(width = 50.dp, height = 25.dp),
347354
targetSize = DpSize(width = 300.dp, height = 150.dp),
@@ -355,6 +362,7 @@ val animatableTextState = rememberAnimatableTextState(
355362
targetFontSize = 36.sp,
356363
toTargetFontSizeAnimationSpec = spring(Spring.DampingRatioHighBouncy, Spring.StiffnessVeryLow)
357364
)
365+
// Merge the states you created into sharedState and pass it to AnimatableCard and AnimatableText
358366
val sharedAnimatableState = rememberSharedAnimatableState(
359367
listOf(
360368
animatableCardState,
@@ -364,7 +372,7 @@ val sharedAnimatableState = rememberSharedAnimatableState(
364372
```
365373
</details>
366374
<details closed>
367-
<summary>Component</summary>
375+
<summary>Components</summary>
368376
<br>
369377

370378
@@ -377,12 +385,12 @@ Box(
377385
) {
378386
AnimatableCard(
379387
modifier = Modifier.size(100.dp),
380-
state = sharedAnimatableState
388+
state = sharedAnimatableState // pass shared state
381389
) {
382390
Box(Modifier.fillMaxSize(), Alignment.Center) {
383391
AnimatableText(
384392
text = "Animatable",
385-
state = sharedAnimatableState
393+
state = sharedAnimatableState // pass shared state
386394
)
387395
}
388396
}

0 commit comments

Comments
 (0)