Animation In Android - PowerPoint PPT Presentation

About This Presentation
Title:

Animation In Android

Description:

Animation is the process of creating motion and shape change. In this Tutorial we will show how simple animations encourage you to use them more freely and confidently. – PowerPoint PPT presentation

Number of Views:484

less

Transcript and Presenter's Notes

Title: Animation In Android


1
(No Transcript)
2
Tables Of Content
  • Animation in Android
  • Types Of Animation
  • Animation methods
  • Interpolate
  • Types of Interpolate
  • Animation File In Android Studio 
  • Animated properties
  • Setting The Animation Listeners
  • Source

3
Animation In Android
  • Android is a mobile operating system developed by
    Google, based on a modified version of the Linux
    kernel and other open source software and
    designed primarily for touchscreen mobile devices
    such as smartphones and tablets.
  • Animation API was introduced by Google in Android
    3.0 which gives us the flexibility to change
    object properties over a certain time interval.
    The Animations Framework allows us to create
    visually attractive animations and transitions in
    our apps.

4
Types of Animation
  • There are three types of animation.
  • 1. View Animation
  • 2. Property Animation
  • 3. Property Animation

5
Animation Methods
  • The Animation class has many methods given below
  • 1.start() This method will start the animation.
  • 2.setDuration(long duration) This method sets
    the duration of an animation.
  • 3.getDuration() This method gets the duration.
  • 4.end() This method ends the animation.
  • 5.cancel() This method cancels the animation.

6
Interpolator
  • It is used to insert or apply an additional
    animation effects between the start and the end
    value of the property of an object. It is also
    used to define the rate of change of an animation

7
Types of Interpolator
  • Linear Interpolator
  • Accelerate Interpolator
  • Decelerate Interpolator
  • Accelerate Decelerate Interpolator
  • Anticipate Interpolator
  • Overshoot Interpolator
  • Anticipate Overshoot Interpolator
  • Bounce Interpolator
  • Cycle Interpolator

8
Animation File In Android Studio 
  • To apply Animations to our Application sometimes
    we need to make an anim folder in Android Studio
    to store animation file under the resource folder
    of our application. Basically there are two
    options for resource types. You can set any of
    these two given below
  • animator/ XML files that define property
    animations.
  • anim/ XML files that define tween animations

9
Animated properties
  • Common properties commonly animated on views
    include

Property Description
alpha Fade in or out
rotation, rotationX, rotationY Spin or flip
scaleX ,scaleY Grow or shrink
x,y,z Position
translationX, translationY, translationZ  (API 21) Offset from Position
10
Setting The Animation Listeners
  • Animation listeners can be set by implementing
    Animation Listener in our Activity. If you will
    use Animation Listener, then you will have to
    override following methods.
  • Scale Animation
  • Rotate Animation
  • Translate Animation
  • Alpha Animation

11
Source
  • http//abhiandroid.com/materialdesign/animation
Write a Comment
User Comments (0)
About PowerShow.com