Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Delight users with Motion Layout

Delight users with Motion Layout

A mix between the property animation framework, layout transitions with TransitionManager, and CoordinatorLayout; Motion Layout is the most powerful transition framework in Android yet.

Being fully declarative, you can use Motion Layout to build delightful animations and keep all the knowledge of layouts and their movements in just XML files.

Github repository: https://github.com/saurabharora90/MotionLayout-Playground

Saurabh

July 17, 2019
Tweet

More Decks by Saurabh

Other Decks in Programming

Transcript

  1. Soompi is the world’s largest K-Pop and lifestyle editorial destination

    for breaking entertainment news, fashion & beauty articles, and exclusive events for international fans of Asian entertainment and culture. Viki is a global video platform, where millions of people watch and engage with their favorite TV shows, Viki Originals, movies, and influencer videos. VIDEO EDITORIAL
  2. Constraint Layout • Complex layouts with a flat hierarchy •

    Specifying constraints on views w.r.t other views • Helpers such as Barriers, Groups & Guidelines
  3. Constraint Layout Animations • Constraint sets • Start scene and

    an End scene • Use transition manager for smooth transition
  4. private val start: ConstraintSet by lazy { val set =

    ConstraintSet() set.clone(this, R.layout.start) set }
  5. private val start: ConstraintSet by lazy { val set =

    ConstraintSet() set.clone(this, R.layout.start) set } private val end: ConstraintSet by lazy { val set = ConstraintSet() set.clone(this, R.layout.end) set }
  6. Motion Layout • Introduced in ConstraintLayout 2.0 • Subclass of

    ConstraintLayout • Works with touch system • Support for intermediate states (keyframes) • Fully declarative
  7. Constrains Layout Params Standard Attributes Visibility Alpha Custom Attributes Elevation

    Scale Rotation Translation • Setter • String, color, float,int or boolean
  8. Constraints Constraint Layout Params Standard Attributes Visibility Alpha Custom Attributes

    Elevation Scale Rotation Translation • Reflection • String, color, float,int or boolean
  9. Recap • Part of constraint layout 2.0 • Works with

    both position/layout and styling attributes • Interruptible and can set progress • Click and Swipe Triggers
  10. A mix between the property animation framework, layout transitions with

    TransitionManager, and CoordinatorLayout - Nicolas Roard
  11. Resources • Google IO’19 Talk • Introduction to Motion Layout

    by Nicolas Roard • Github : MotionLayout-Playground : https://github.com/saurabharora90/MotionLayout-Playground
  12. Q&A