How to create basic Image animations for tablets using "android.animation" package

I have created some applications for image and movies using android.view package. Now I want to create the same for the Android tablets.

I see that I can use android.animation packages for Android 3.0, but I cannot find any documentation to apply fade, zoom effects using this package. I am trying to convert all my source code in this package.

How do I use the ValueAnimator and ObjectAnimator? In the Api Demo, I found this code piece for fading. But how do I assign the Alpha value? In view.animation, I had fromAlpha, toAlpha...

ValueAnimator fadeAnim = ObjectAnimator.ofFloat(newBall, "alpha", 1f, 0f); fadeAnim.setDuration(250); fadeAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { balls.remove(((ObjectAnimator)animation).getTarget()); } });

Again I have this code piece:

ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f); anim.setDuration(500); anim.start();

When do I use ValuAnimator and when do I use ObjectAnimator?

-------------Problems Reply------------

there are two blogposts on this subject on the android developer blog, http://android-developers.blogspot.com/2011/02/animation-in-honeycomb.html and http://android-developers.blogspot.com/2011/05/introducing-viewpropertyanimator.html

I strongly recomend both articles as I got a very good understanding of the new animation APIs after reading them.

Category:java Views:1 Time:2011-06-13

Related post

  • How do you create a wiggle animation similar to iphone deletion animation 2010-09-13

    We are currently developing an application that contains a series of icons. We want the icons to wiggle like the app deletion animations when pressed. What would be the best way to code this animation sequence? --------------Solutions------------- Th

  • Photos uploaded onto my website, created in Publisher, do not show on android tablet 2012-02-10

    Photos uploaded onto my website, created in Publisher, do not show on android tablet. Some of the hyperlinks do not work also. Is this a problem with Publisher or Android please? --------------Solutions------------- Go to tools > options > Web

  • Can I create a rule only in tablet pc so that I can receive emails in my tablet pc at specific times. 2013-08-22

    Outlook rules I have one Tablet PC and one Laptop, I already installed my company outlook email in My laptop, and now I want to install the outlook in tablet pc too, but my email is big size and I don’t want to keep all emails in tablet as there is n

  • android animation is not finished in onAnimationEnd 2011-01-20

    It seems that an android animation is not truly finished when the onAnimationEnd event is fired although animation.hasEnded is set to true. I want my view to change it's background drawable on the end of it's ScaleAnimation which it does, but you can

  • android animations for view flipper? 2011-06-23

    i am looking for an animation for a view flipper. How would i go about animating so that the view basically goes back to front when a button is pressed. where there is a map view on one side and a listview on the other. i have the above working excep

  • Android Animation Library? 2011-07-13

    Are there any FREE Android Animation Libraries that we can use in our applications ? The android built-in animations are very basic. I want something more fancy. - Thanks in advance. --------------Solutions------------- There is one out there now. Ni

  • Android Animation: Hide/Show Menu 2011-08-15

    I am trying to add an animation to my app that will hide or show a menu on single tap. Basically something similar to Pulse news readers article view. I am able to animate the menu container. However,the menu does not slide down at the same time as t

  • Android animation causing "Activity idle timeout for History Record" on start up 2011-08-16

    I have been searching for an answer to this and while I can find others who have been seeing the same entries in the log cat none of the footprints seem to be similar to mine. Basically I start an infinitely repeating animation as part of my activity

  • css3 animation on :hover; force entire animation 2011-10-08

    I've created a simple bounce animation which i'm applying to the :hover state of an element: @keyframes bounce { 0% { top: 0; animation-timing-function: ease-out; } 17% { top: 15px; animation-timing-function: ease-in; } 34% { top: 0; animation-timing

  • How to recreate animation as in "PATH android app " in their user profile page? 2013-01-14

    In path application the user can drag the profile info down to reveal the image of the user . I need same animation in our app . Can anyone guide me how to create this animation in android ? I am talking about animation in http://cl.ly/MBQh Thanks --

  • Resize animated GIF file without destroying animation 2009-04-05

    I need to resize an animated GIF file without destroying the animation. How can I do it using PHP? --------------Solutions------------- if you have imagemagick access, you can do this: system("convert big.gif -coalesce coalesce.gif"); system("convert

  • Android Animation - Flip 2010-07-29

    I need to create an animation - Flip a view and show another one. The width of currently shown view is decreased slowly to zero and after that the width of the view-to-be-shown must be increased from zero. During this time, the height goes from the c

  • How can I create a sliding layout, like the main android menu? 2010-10-13

    I need to create an application with 4 view. I need to pass from a view to an other simply by a touch and a move to the left or to the right (no button). The effect I would like is the same that you see when you navigate in the main menu of android w

  • Creating a multi-table SQL database in android 2010-10-23

    I'm trying to create a multi-table database for my android application. I'm following the suggestion given on this site http://androidforbeginners.blogspot.com/2010/01/creating-multiple-sqlite-database.html for doing it. I keep on getting the error b

  • random frame animation does not work android 2010-11-07

    I am trying to achieve a random animation of from a set of images, where each frame is a random image from the image set. And for this I am using addFrame method of AnimationDrawable object but the animation is not working. I tried searching various

  • Android animation does not repeat 2010-12-18

    I'm trying to make simple animation that would repeat several times (or infinitely). It seems that android:repeatCount does not work! Here is my animation resource from /res/anim/first_animation.xml : <?xml version="1.0" encoding="utf-8"?> <

  • Can I launch an Android animation in the onanimationEnd callback of the previous one? 2011-01-05

    I am attempting to launch one animation after another has finished by monitoring the onanimationEnd callback of the first one. However Android gives the following error when I attempt to do this: Error - The method loadAnimation(Context, int) in the

  • Android animation startOffset makes the target view blink and not animate 2011-01-06

    I'm trying to create an animation which will slide a textview out to the left and slide in again from the right. Essentially, this would be the same text effect used in the Stopwatch & Timer app (sportstracklive is the developer). I can use eithe

  • Android animation XML issues 2011-02-11

    I'm trying to use Android's animation framework to have my ImageView move in a diamond pattern. Here's my animation.xml: <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="true"> <translate android:fro

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.174 (s). 11 q(s)