Skip to content

MotionEffect

Nicolas Roard edited this page Mar 11, 2021 · 17 revisions

MotionEffect

This new motion helper in 2.1 let you automatically add keyframes to the views it references, depending on their overall movement direction.

To better understand where this is useful, take the following example:

The default transition between the two states do a linear interpolation -- the result is a confusing and not pleasant.

If we look at this example, we can identify elements that are moving west only (2, 3, 6, 9), and others moving in a different pattern (1, 4, 5, 7, 8):

We can use MotionEffect to apply a fade effect to those elements, giving a much more pleasant result: