Skip to content

Commit 068d77c

Browse files
NUmeroAndDevhunterstich
authored andcommitted
[Motion] Fixed documentation
Resolves #1490 GIT_ORIGIN_REV_ID=320582f0e3c652c4d0f2e510659eed78c6f50248 PiperOrigin-RevId: 322159796
1 parent acc99c9 commit 068d77c

File tree

1 file changed

+3
-33
lines changed

1 file changed

+3
-33
lines changed

docs/theming/Motion.md

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ them, check out the
1515
[Material motion system spec](https://material.io/design/motion/the-motion-system.html).
1616

1717
Before you can use the motion library, you need to add a dependency on the
18-
Material Components for Android library (version `1.2.0-rc01` or later). For
18+
Material Components for Android library (version `1.2.0-beta01` or later). For
1919
more information, go to the
2020
[Getting started](https://github.com/material-components/material-components-android/tree/master/docs/getting-started.md)
2121
page.
@@ -156,46 +156,16 @@ transition to the the provided `Hold` transition.
156156

157157
```kt
158158
// FragmentA.kt
159-
fun onCreate(savedInstanceState: Bundle?) {
159+
override fun onCreate(savedInstanceState: Bundle?) {
160160
super.onCreate(savedInstanceState)
161161

162162
// Fragment A’s exitTransition can be set any time before Fragment A is
163-
// replaced with Fragment B. Ensure Hold's duration is set to the same
163+
// replaced withFragment B. Ensure Hold's duration is set to the same
164164
// duration as your MaterialContainerTransform.
165165
exitTransition = Hold()
166166
}
167167
```
168168

169-
Alternatively, to subtly scale and fade Fragment A while the container transform
170-
is playing, set FragmentA's exit and reenter transitions to a
171-
`MaterialElevationScale` transition. This will help to reinforce the spatial
172-
relationship and navigational hierarchy of the two screens along the z-axis.
173-
174-
```kt
175-
// FragmentA.kt
176-
fun onCreate(savedInstanceState: Bundle?) {
177-
super.onCreate(savedInstanceState)
178-
179-
exitTransition = MaterialElevationScale(/* growing= */ false)
180-
reenterTransition = MaterialElevationScale(/* growing= */ true)
181-
}
182-
```
183-
184-
We pass in `false` for the exit `MaterialElevationScale` `growing` constructor
185-
param, to scale down or shrink Fragment A when it is exiting during the enter
186-
container transform. Whereas we pass in `true` for the reenter
187-
`MaterialElevationScale` to scale up or expand Fragment A when it is reentering
188-
during the return container transform.
189-
190-
_**Note:** When using `MaterialElevationScale`, make sure to mark the root view
191-
of your Fragment as a
192-
[transition group](https://developer.android.com/reference/android/view/ViewGroup#setTransitionGroup\(boolean\)),
193-
either with `android:transitionGroup="true"` for API level 21+ or
194-
`ViewGroupCompat#setTransitionGroup` for all API levels. This will ensure that
195-
the animation is applied to the Fragment view as a whole, as opposed to each
196-
child view individually, which is the default behavior of the Android
197-
Transitions system._
198-
199169
#### Transition between Activities
200170

201171
_**Note:** Activity and Window transitions require using Android Framework

0 commit comments

Comments
 (0)