Your SlideShare is downloading. ×
Android animation
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Android animation

495
views

Published on

Published in: Technology, Business

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
495
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Mobile Computing – 650003 MCA – ISTAR, V.V. Nagar 1Mr. Pritesh N. Patel (ISTAR)
  • 2. Types of Animation Android support following types of animation 1. Animated GIF files 2. Frame-by-Frame Animation 3. Tweened Animation 2Mr. Pritesh N. Patel (ISTAR)
  • 3.  In these type of animation, a series of similar images displayed in sequence, each image is different from one another from first to last.  It display images so quickly by giving illusion of moving animation.  These type of animation is used when transformation is not easy with programming. Code Sample 3Mr. Pritesh N. Patel (ISTAR) Frame-by-Frame Animation
  • 4.  In these type of animation, animation can perform simple transformation on the content of view.  Transformation can be position, size, rotation and transparency.  The animation package provide all the classes used in tween animation like RotateAnimation, ScaleAnimation, Transformation, TranslateAnimation, etc.  We can also provide transformation to any view. Code Sample 4Mr. Pritesh N. Patel (ISTAR) Tweened Animation
  • 5.  We can define animation programmatically using classes available in android.view.animation package. For e.g. to define rotation RotateAnimation r = new RotateAnimation( 0, 360, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); r.setDuration(500); 5Mr. Pritesh N. Patel (ISTAR) Define Tweened Animation Programmatically
  • 6.  RotateAnimation (float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)  ScaleAnimation (float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)  TranslateAnimation (int fromXType, float fromXValue, int toXType, float toXValue, int fromYType, float fromYValue, int toYType, float toYValue) 6Mr. Pritesh N. Patel (ISTAR) Syntax:
  • 7.  We can define animation as XML resource at file location res/anim/my_anim.xml like (see syntax in given doc file) <set android:interpolator="@android:anim/accelerate_interp olator” android:startOffset="700"> <rotate android:fromDegrees="0" android:toDegrees="-45" android:toYScale="0.0" android:pivotX="50%" android:pivotY="50%" android:duration="400" /> </set> 7Mr. Pritesh N. Patel (ISTAR) Define Tweened Animation as XML Resource

×