SlideShare a Scribd company logo
Android Animation Theory
Siva Ramakrishna
Agenda
❖Overview
❖Animation Systems
❖Details of each System
❖References
Overview
❖Android provides variety of APIs to animate UI elements and create
custom 2D and 3D graphics.
❖The presentation details about the available techniques to create
different animations using different systems provided by android.
Animation Systems
Android provides the following 3 different animation systems.
❖Property Animation
❖View Animation
❖Drawable Animation
Property Animation
❖Introduced in Android 3.0 version.
❖Allows to animate property of any object including the one which is not
visible to the user.
❖Allows to animate on custom types as well.
❖Extensible.
How it works?
❖Modifies the property value of an object over a specified period of time.
❖Property of an object is nothing but the field in an object.
❖To animate, specify the below things.
❖what property value you want to change over a time. Ex: object’s position
❖duration of the animation
❖range of values
continued...
Property animation system lets you define the following things.
❖ Duration
➢ Duration of the animation.
❖ Time Interpolation
➢ How the property value should be changed over the time. Its a fn of time.
❖ Repeat Count and behavior
➢ whether to repeat the animation or not and also the behavior of the animation.
❖ Animator Sets
example
In the above example, consider ‘x’ is the property of the object.
observe the value of ‘x’ changes over the period of 40ms.
interpolator determines the value of ‘x’ based on linear or nonlinear fn of time.
Hence it plays very important role for creating any animation.
ValueAnimator
❖ValueAnimator object keeps track of your animation's timing, such as how long
the animation has been running, and the current value of the property that it is
animating.
ValueAnimator
❖The ValueAnimator encapsulates TimeInterpolator and TypeEvaluator.
❖TimeInterpolator which defines the interpolation of the animation.
Android supports many implementations of TimeInterpolator.
➢ Ex: AccelerateInterpolator
❖TypeEvaluator which defines how to calculate the property value of the
animation. Android provides many implementations TypeEvaluators.
➢ Ex: IntEvaluator
❖ValueAnimator, TimeInterpolator and TypeEvaluator work hand in hand to
complete the animation.
Utility classes
❖ObjectAnimator
➢ Sub class of ValueAnimator which allows to set target object and object’s property to
animate.
➢ Makes the process of animating values of target objects much easier.
➢ Sometimes you may have to use ValueAnimator due some restriction on the
objectAnimator where some of the property access methods are not accessible/missing.
❖ AnimatorSet
➢ Animations can be grouped and played related to each other.
➢ Animations can be played sequentially, after a delay between each animation.
View Animation
❖Can be used to perform the tweened animation on the views.
❖A tween animation can perform series of
transformations(position,size,rotation and transparency) on the content of
the view object. Ex: if you have a textview, you can move,rotate, shrink and
grow the size.
❖Animation can be defined either in XML file or in code. XML file is more
readable and reusable.
❖Animation instructions defines the transformation you want to occur,
animation duration, when to occur.
Drawable Animation
❖Lets you load a series of drawable resources to create an animation.
❖Traditional style of creating an animation where series of images played
like film roll.
❖AnimationDrawable is the main class to define animation through code.
❖Animation can be created using XML file as well.
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true">
<item android:drawable="@drawable/rocket_thrust1" android:duration="200" />
<item android:drawable="@drawable/rocket_thrust2" android:duration="200" />
<item android:drawable="@drawable/rocket_thrust3" android:duration="200" />
</animation-list>
Property Animation vs View Animation
❖View Animation only allows
➢ to animate view objects. Non-view objects can not animated using this system.
➢ Only few aspects of the view can be animated like size, rotation, transparency.
➢ Original object of the view will not be changed.
❖ Using Property Animation all the above limitation can be removed as it is
more modular.
❖However, View Animation system takes less setup time and required less
code to be written.
References and Resources
❖For defining animation in an XML file. Refer
http://developer.android.com/guide/topics/resources/animation-
resource.html
❖Refer API Demo Sample(animation package) for examples.
❖http://developer.android.com/guide/topics/graphics/overview.html
❖http://android-developers.blogspot.in/2011/05/introducing-
viewpropertyanimator.html

More Related Content

PDF
[Android] Android Animation
PPTX
Android animations
PPTX
Android Training (Animation)
ODP
Android App Development - 12 animations
PPTX
Basic Android Animation
PDF
Android animation
PDF
Introduction to Android Animations
PPTX
Animations & swift
[Android] Android Animation
Android animations
Android Training (Animation)
Android App Development - 12 animations
Basic Android Animation
Android animation
Introduction to Android Animations
Animations & swift

What's hot (17)

KEY
Animation in iOS
PDF
Animate The Web With Ember.js - Jessica Jordan
PPTX
TMD2063 | Digital Animation - Chapter 2
PDF
Core Animation
PPTX
Animation 2013 bis_taj
PDF
Stop running from animations droidcon London
PPTX
Chap18 19
PPTX
PPTX
Animation and Video
PPT
Computer animation
PPTX
PPT
Animation in present day's
PPTX
ANIMATION SEQUENCE
PPTX
Raster animation
PPTX
Animations
PPTX
Development of a 3d animated short film using 3d animation technique
DOCX
Android animation and color state list resources-chapter 10
Animation in iOS
Animate The Web With Ember.js - Jessica Jordan
TMD2063 | Digital Animation - Chapter 2
Core Animation
Animation 2013 bis_taj
Stop running from animations droidcon London
Chap18 19
Animation and Video
Computer animation
Animation in present day's
ANIMATION SEQUENCE
Raster animation
Animations
Development of a 3d animated short film using 3d animation technique
Android animation and color state list resources-chapter 10
Ad

Viewers also liked (20)

PDF
Android design and Custom views
PPTX
Android Transition
PPTX
Animation theory pro forma1
PPTX
ppt based on android technology with great animations
PPTX
Android Animator
PPT
Android UI Patterns
PPTX
Material design for android
PDF
Android Material Design APIs/Tips
PPTX
School Management System in Android
PPTX
Material design - AndroidosDay 2015
PPTX
Android share preferences
PPTX
Android ppt
PPT
Introduction to Android Fragments
POT
Android Material Design
ODP
Image Processing with OpenCV
PDF
Material design basics
PPTX
Materials design
PPTX
Esp chap 4 materials design (finished)
PPTX
Material Design Android
PPTX
Android Design Patterns
Android design and Custom views
Android Transition
Animation theory pro forma1
ppt based on android technology with great animations
Android Animator
Android UI Patterns
Material design for android
Android Material Design APIs/Tips
School Management System in Android
Material design - AndroidosDay 2015
Android share preferences
Android ppt
Introduction to Android Fragments
Android Material Design
Image Processing with OpenCV
Material design basics
Materials design
Esp chap 4 materials design (finished)
Material Design Android
Android Design Patterns
Ad

Similar to Android animation theory (20)

DOCX
Android animation in android-chapter17
PPTX
Animation in android
DOCX
Android view animation in android-chapter18
PPTX
Animation
PDF
Enhancing UI/UX using Java animations
PPTX
Animate me, If you don't do it for me do it for Chet :)
PDF
The world of Android Animations
PPTX
Android webinar class_4
PPTX
Android - Graphics Animation in Android
ODP
Day seven
PDF
Animações Fluídas no Android - DevFestPR 17
PPTX
Advance ui development and design
PDF
Android 2D Drawing and Animation Framework
PPTX
Android 3
PDF
3.2 ws WMS.pdf
PDF
Graphicsand animations devoxx2010 (1)
PDF
Beauty Treatment for your Android Application
PPTX
Animations avec Compose : rendez vos apps chat-oyantes
PDF
How to implement react native animations using animated api
Android animation in android-chapter17
Animation in android
Android view animation in android-chapter18
Animation
Enhancing UI/UX using Java animations
Animate me, If you don't do it for me do it for Chet :)
The world of Android Animations
Android webinar class_4
Android - Graphics Animation in Android
Day seven
Animações Fluídas no Android - DevFestPR 17
Advance ui development and design
Android 2D Drawing and Animation Framework
Android 3
3.2 ws WMS.pdf
Graphicsand animations devoxx2010 (1)
Beauty Treatment for your Android Application
Animations avec Compose : rendez vos apps chat-oyantes
How to implement react native animations using animated api

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Understanding_Digital_Forensics_Presentation.pptx
Big Data Technologies - Introduction.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MIND Revenue Release Quarter 2 2025 Press Release
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
sap open course for s4hana steps from ECC to s4
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Chapter 3 Spatial Domain Image Processing.pdf

Android animation theory

  • 3. Overview ❖Android provides variety of APIs to animate UI elements and create custom 2D and 3D graphics. ❖The presentation details about the available techniques to create different animations using different systems provided by android.
  • 4. Animation Systems Android provides the following 3 different animation systems. ❖Property Animation ❖View Animation ❖Drawable Animation
  • 5. Property Animation ❖Introduced in Android 3.0 version. ❖Allows to animate property of any object including the one which is not visible to the user. ❖Allows to animate on custom types as well. ❖Extensible.
  • 6. How it works? ❖Modifies the property value of an object over a specified period of time. ❖Property of an object is nothing but the field in an object. ❖To animate, specify the below things. ❖what property value you want to change over a time. Ex: object’s position ❖duration of the animation ❖range of values
  • 7. continued... Property animation system lets you define the following things. ❖ Duration ➢ Duration of the animation. ❖ Time Interpolation ➢ How the property value should be changed over the time. Its a fn of time. ❖ Repeat Count and behavior ➢ whether to repeat the animation or not and also the behavior of the animation. ❖ Animator Sets
  • 8. example In the above example, consider ‘x’ is the property of the object. observe the value of ‘x’ changes over the period of 40ms. interpolator determines the value of ‘x’ based on linear or nonlinear fn of time. Hence it plays very important role for creating any animation.
  • 9. ValueAnimator ❖ValueAnimator object keeps track of your animation's timing, such as how long the animation has been running, and the current value of the property that it is animating.
  • 10. ValueAnimator ❖The ValueAnimator encapsulates TimeInterpolator and TypeEvaluator. ❖TimeInterpolator which defines the interpolation of the animation. Android supports many implementations of TimeInterpolator. ➢ Ex: AccelerateInterpolator ❖TypeEvaluator which defines how to calculate the property value of the animation. Android provides many implementations TypeEvaluators. ➢ Ex: IntEvaluator ❖ValueAnimator, TimeInterpolator and TypeEvaluator work hand in hand to complete the animation.
  • 11. Utility classes ❖ObjectAnimator ➢ Sub class of ValueAnimator which allows to set target object and object’s property to animate. ➢ Makes the process of animating values of target objects much easier. ➢ Sometimes you may have to use ValueAnimator due some restriction on the objectAnimator where some of the property access methods are not accessible/missing. ❖ AnimatorSet ➢ Animations can be grouped and played related to each other. ➢ Animations can be played sequentially, after a delay between each animation.
  • 12. View Animation ❖Can be used to perform the tweened animation on the views. ❖A tween animation can perform series of transformations(position,size,rotation and transparency) on the content of the view object. Ex: if you have a textview, you can move,rotate, shrink and grow the size. ❖Animation can be defined either in XML file or in code. XML file is more readable and reusable. ❖Animation instructions defines the transformation you want to occur, animation duration, when to occur.
  • 13. Drawable Animation ❖Lets you load a series of drawable resources to create an animation. ❖Traditional style of creating an animation where series of images played like film roll. ❖AnimationDrawable is the main class to define animation through code. ❖Animation can be created using XML file as well. <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true"> <item android:drawable="@drawable/rocket_thrust1" android:duration="200" /> <item android:drawable="@drawable/rocket_thrust2" android:duration="200" /> <item android:drawable="@drawable/rocket_thrust3" android:duration="200" /> </animation-list>
  • 14. Property Animation vs View Animation ❖View Animation only allows ➢ to animate view objects. Non-view objects can not animated using this system. ➢ Only few aspects of the view can be animated like size, rotation, transparency. ➢ Original object of the view will not be changed. ❖ Using Property Animation all the above limitation can be removed as it is more modular. ❖However, View Animation system takes less setup time and required less code to be written.
  • 15. References and Resources ❖For defining animation in an XML file. Refer http://developer.android.com/guide/topics/resources/animation- resource.html ❖Refer API Demo Sample(animation package) for examples. ❖http://developer.android.com/guide/topics/graphics/overview.html ❖http://android-developers.blogspot.in/2011/05/introducing- viewpropertyanimator.html