Android Animation
As We Know It

 

Contents

1. Property, Drawable and View animations

 

Contents

 

1. Property, Drawable and View animations

2. Shared objects & custom animations

 

Contents

 

1. Property, Drawable and View animations

2. Shared objects & custom animations

3. Layout animations & transitions framework

 

Contents

 

1. Property, Drawable and View animations

2. Shared objects & custom animations

3. Layout animations & transitions framework

4. Ripples, state change animation, Reveals

 

Contents

 

1. Property, Drawable and View animations

2. Shared objects & custom animations

3. Layout animations & transitions framework

4. Ripples, state change animation, Reveals

5. Libraries

 

Contents

 

1. Property, Drawable and View animations

2. Shared objects & custom animations

3. Layout animations & transitions framework

4. Ripples, state change animation, Reveals

5. Libraries

6. Inspiration

 

Property

 Drawable

View

 

Property

 Drawable

View

 

Animator

ValueAnimator

ObjectAnimator

AnimatorSet

ViewPropertyAnimator

ValueAnimator

ObjectAnimator

ViewPropertyAnimator

 * Honeycomb and newer

ViewPropertyAnimator

 * Honeycomb and newer

Property

 
  • universal

  • works with almost all objects

  • change the object, not its presentation

  • not tied to View objects

  • many types of animation

 
  • not defined

 

Few words about Interpolator

 

Linear Interpolator

 

Accelerate Interpolator

 

Decelerate Interpolator

 

Other

 

Custom Interpolator

 

y=0.5*((2*t−1)^3+1)​

 

Custom Interpolator

 

y=0.5*((2*t−1)^3+1)​

 

Custom Interpolator

 

y=0.5*((2*t−1)^3+1)​

 

Custom Interpolator

 

y=0.5*((2*t−1)^3+1)​

 

(c) Andrew Komrachkov

 

Property

 Drawable

View

 

Define frames

 

drawable_animation.xml

 

Start in code

 

Drawable

 
  • super complicated animations with various effects

 
  • complicated changes 

  • large number of resources and long build 

  • difficult to create

 

Property

 Drawable

View

 

Code

 

XML

 

Result

 

View

 
  • not defined

 
  • works with View only

  • executes only with onDraw()

  • one animation per object (but have AnimationSet)

  • elementary types (transition, size, rotation, scale)

  • animation doesn't change object

 

Shared objects

 

Custom animations

 

Shared objects

 

Custom animations

 

Shared objects

 
  • nice animation effect

  • intuitive transition

 
  • not supported on pre-Lollipop devices (except middle quality backports)

 

XML

 

Parent screen

 

Child screen

 

Code

 

Result

 

Shared objects

 

Custom animations

 

Activity

 

ActivityOptions

 

*API 16+

 

makeCustomAnimation(

Context context,

int enterResId,

int exitResId)

 

ActivityOptions example

 

Fragment

 

*in.xml

 

*out.xml

 

&

 

card_flip_left_in.xml

 

card_flip_left_out.xml

 

&

 

XML

 

card_flip_left_in.xml

 

XML

 

card_flip_left_out.xml

Code

 

Layout animations

 

Transitions framework

 

Layout animations

 

Transitions framework

 

#1

XML

 

*API 11+

 

#2

Code

 

*API 16+

 

Layout animations

 

Transitions framework

 

TransitionManager.

beginDelayedTransition();

Simple and beautiful

Code #1

Code #2

Ripples

 

State change animation

 

Reveals

 

Ripples

 

State change animation

 

Reveals

 

Code

 

Ripples

 

State change animation

 

Reveals

 

Code

 

Ripples

 

State change animation

 

Reveals

 

Code #1

 

Code #2

 

Libraries

 

PreLollipopTransition

 

API 14+

android-ui

 

API 14+

CircularTools

 

API 11+

Motion

 

API 8+

Android View Animations

 

API 8+

android-pathview

 

API 14+

android-player

 

API 12+

github.com/snowdream/awesome-android

 

  • 729 libraries for Android

  • 131 tools and project samples

  • sorted by categories 

  • updates

 

android-arsenal.com

 

 

  • 1983 libraries for Android

  • 189 tools and project samples

  • sorted by categories 

  • updates

 

Inspiration

 

dribbble.com

 

Valeriy Palamarchuk

 

Q&A

 

Android Animation As We Know It

By Valeriy Palamarchuk

Android Animation As We Know It

  • 1,100