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

Everyday Animations in Android

Everyday Animations in Android

Animation is often seen as a nice-to-have or gratuitous in software projects. In truth, animations actually exist to improve an app's user experience. Animations help users understand state changes, guide them to notice meaningful information, gather focus to a required action, or express relationships between UI elements. This session examines traditional techniques using property and drawable animations, as well as the new MotionLayout introduced at Google I/O 2018. These techniques can expand content, display state, move elements, and highlight important controls. Properly executed animation effects are applicable to buttons, lists, and images in any Android app, taking an app's user experience from good to great.

David Truxall

January 11, 2019
Tweet

More Decks by David Truxall

Other Decks in Programming

Transcript

  1. Animation Types ❖ View Animation ❖ Property Animation ❖ Layout

    Animation ❖ Physics Animation ❖ MotionLayout
  2. Property Animations view.setOnClickListener { onStartAnimation() } ...... fun onStartAnimation() {

    val animator = ValueAnimator.ofFloat(0f, -screenHeight) animator.addUpdateListener { val value = it.animatedValue as Float rocket.translationY = value } animator.interpolator = LinearInterpolator() animator.duration = 1000 animator.start() }
  3. MotionLayout 1.Define starting and ending constraints 2.Move constraints to a

    Scene XML file 3.Define a trigger Layout Scene Constraint Set Start Constraint Set End Trigger Key Frames
  4. App Architecture ❖ Kotlin ❖ Architecture Components ❖ MVVM ❖

    LiveData ❖ Room ❖ Navigation ❖ Fragments
  5. MotionLayout 1.Define starting and ending layouts 2.Move constraints to a

    Scene XML file 3.Define a trigger Layout Scene Constraint Set Start Constraint Set End Trigger Key Frames