Ashera supports cross platform animation using animation set and also supports motion layout which adds animation to constraint layout.
Animation set represents a group of Animations that should be played together. The transformation of each individual animation are composed together into a single transform.
The animation set is defined in xml file under res/animator. Interpolators are defined in xml file under anim res/folder.
To support animation on a view, Ashera has extended view to add the following attributes:
This example shows different animations that are supported.
In layout XML file, set the android:animateLayoutChanges attribute to true for the layout that you want to enable animations for:
<LinearLayout android:id="@+id/container"
android:animateLayoutChanges="true"
...
/>
MotionLayout bridges the gap between layout transitions and complex motion handling, offering a mix of features between the property animation framework, TransitionManager, and CoordinatorLayout.
In addition to describing transitions between layouts, MotionLayout lets you animate any layout properties. Moreover, it inherently supports seekable transitions. This means you can instantly show any point within the transition based on some condition, such as touch input. MotionLayout also supports keyframes, enabling fully customized transitions to suit your needs.
MotionLayout is fully declarative, meaning you can describe any transitions in XML, no matter how complex.
This example contains a single view that you can touch and drag to move horizontally.
This example is similar to the Basic motion example. In addition to the basic motion, the background color of the view changes as the view moves.
This example uses <KeyFrameSet> to alter the Y position of the view during motion.
This example builds on the Keyframe position example, adding rotation and scaling to the view transition.
This example adds <KeyCycle> elements to add wavelike motion to the view
This example demonstrates how to hide/show a view when the transition crosses a progress threshold..