Question about LayoutAnimation2.java from the ApiDemos sample project

by DS » Fri, 27 Jun 2008 03:41:52 GMT


Sponsored Links
 Hello,

Hoping that someone can provide some insights into how android
animations work.

In the onCreate() method of file LayoutAnimation2.java, we have the
following AnimationSet being created

        AnimationSet set = new AnimationSet(true);

        Animation animation = new AlphaAnimation(0.0f, 1.0f);
        animation.setDuration(50);
        set.addAnimation(animation);

        animation = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF,
0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF,
-1.0f,Animation.RELATIVE_TO_SELF, 0.0f
        );
        animation.setDuration(100);
        set.addAnimation(animation);


First I dont understand why there needs to be a translate animation in
addition to an AlphaAnimation. Anyway, if I comment out the last line
from the above code snippet. i.e., the AnimationSet now only has an
AlphaAnimation in it, the something very strange happens. The ListView
renders without any text being shown....until we hit a down-arrow key.
An then the list text shows up animating itself as expected.

So, for you experts out there, what the heck is going on?

- Why does one need these two animations added to the set
- Why does the ListView rendering stall the way it does
- Why does hitting a key-stroke get it unstuck
- Why is the ApiDemos code not commented at all? (this one is an extra
credit question)

Thanks in advance,

DS.






--~--~---------~--~----~------------~-------~--~----~



Question about LayoutAnimation2.java from the ApiDemos sample project

by Romain Guy » Fri, 27 Jun 2008 04:25:10 GMT


 Hi,


You don't need the two animations. The effect I wrote in this sample
just happen to do a translate + alpha because it looks better.


It doesn't for me. Might be a bug in M5 we fixed since then.


Probably because it forced a layout + invalidate that refreshed the drawing.


Too many things to do :)

-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Question about LayoutAnimation2.java from the ApiDemos sample project

by Romain Guy » Sat, 28 Jun 2008 01:40:01 GMT


 Hi,

We are aware of this. However what needs to be done at this time is to
make the software works. Before the SDK 1.0 ships, we will spend time
cleaning it up and adding documentation. Unfortunately, this is not
our priority today (but it will be :). In the meantime feel free to
ask questions, we'll be happy to assist as much as we can.








-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. AVD creation in Eclipse should be automatic

Hi Folks,
 In Eclipse, when launching the de{*filter*}/emulator, the AVD selection
is blank until you manually create an AVD by using a command line.

 It seems that Eclipse knows, because it asks you, which platform you
are using (Android 1.1 vs 1.5 vs 1.5+Google) and it knows what you
named the run/debug configuration. So, it really has what it needs to
create a default AVD, but it doesn't.

End to End funtionality is what makes products great.
--~--~---------~--~----~------------~-------~--~----~

2. Get rich $$ from ur computer ... no fees

for details .. visit www.apnapaisa.tk

recent topics

   - Win Cellphone<http://apnaapaisa.blogspot.com/2009/05/win-cellphone.html>
   - www.oprah.com/kfc - Oprah KFC Coupons
Free<http://apnaapaisa.blogspot.com/2009/05/wwwoprahcomkfc-oprah-kfc-coupons-free.html>
   - Share Your File Earn Dollars From
Ziddu.com<http://apnaapaisa.blogspot.com/2009/05/share-your-file-earn-dollars-from.html>
   - Earn Points and Cash With Cashle |
Points2Shop<http://apnaapaisa.blogspot.com/2009/05/earn-points-and-cash-with-cashle.html>
   - Earn Cash By Submit Your Articles, Files &
Documen...<http://apnaapaisa.blogspot.com/2009/05/earn-cash-by-submit-your-articles-files.html>
   - Blogger 
[Monetize]<http://apnaapaisa.blogspot.com/2009/05/blogger-monetize.html>
   - Top Paying Keywords for Adsense
2009<http://apnaapaisa.blogspot.com/2009/05/top-paying-keywords-for-adsense.html>
   - Is it possible to earn money online, working
form...<http://apnaapaisa.blogspot.com/2009/05/is-it-possible-to-earn-money-online.html>
   - PTC <http://apnaapaisa.blogspot.com/2009/05/ptc.html>
   - How to Get Rich 25
Ways<http://apnaapaisa.blogspot.com/2009/05/how-to-get-rich-25-ways.html>
   - How to Get Started in Network
Marketing<http://apnaapaisa.blogspot.com/2009/05/how-to-get-started-in-network-marketing.html>
   - You Wanna Make Money Network
Marketing<http://apnaapaisa.blogspot.com/2009/05/you-wanna-make-money-network-marketing.html>
   - Earn Money through Affiliate
Programs<http://apnaapaisa.blogspot.com/2009/04/earn-money-through-affiliate-programs.html>
   - Other Pay Per Click
Programs<http://apnaapaisa.blogspot.com/2009/04/other-pay-per-click-programs.html>
   - Online Money at
Home<http://apnaapaisa.blogspot.com/2009/04/online-money-at-home.html>
   - Earn through Starting Online
Forum<http://apnaapaisa.blogspot.com/2009/04/earn-through-starting-online-forum.html>
   - Build Articles
Website<http://apnaapaisa.blogspot.com/2009/04/build-articles-website.html>
   - Making money ... is it a myth
??<http://apnaapaisa.blogspot.com/2009/04/making-money-is-it-myth.html>
   - Make Money
Blogging<http://apnaapaisa.blogspot.com/2009/04/make-money-blogging.html>
   - Web Surveys <http://apnaapaisa.blogspot.com/2009/04/web-surveys.html>
   - Earning Cash Online With Google
AdSense<http://apnaapaisa.blogspot.com/2009/04/earning-cash-online-with-google-adsense.html>
   - Quick Money Making
Ideas<http://apnaapaisa.blogspot.com/2009/04/quick-money-making-ideas.html>
   - Making Money With Article
Marketing<http://apnaapaisa.blogspot.com/2009/04/making-money-with-article-marketing.html>
   - Can You Make Money By Starting Your Own Article
Di...<http://apnaapaisa.blogspot.com/2009/04/can-you-make-money-by-starting-your-own.html>
   - What Is The Best Way To Monetize My
Site?<http://apnaapaisa.blogspot.com/2009/04/what-is-best-way-to-monetize-my-site.html>
   - So You Want to Make Money
Online<http://apnaapaisa.blogspot.com/2009/04/so-you-want-to-make-money-online.html>
   - How AdSense can Make You
Money<http://apnaapaisa.blogspot.com/2009/04/how-adsense-can-make-you-money.html>
   - Blogbank: Earn More Money From Your
Blog<http://apnaapaisa.blogspot.com/2009/04/blogbank-earn-more-money-from-your-blog.html>
   - How To Earn $1 A Day In Google
Adsense<http://apnaapaisa.blogspot.com/2009/04/how-to-earn-1-day-in-google-adsense.html>
   - Earn money from your
site<http://apnaapaisa.blogspot.com/2009/04/earn-money-from-your-site.html>
   - Earn Through Network
Marketing<http://apnaapaisa.blogspot.com/2009/04/earn-through-network-marketing.html>
   - Read emails or Surf the
Web<http://apnaapaisa.blogspot.com/2009/04/read-emails-or-surf-web.html>
   - Earn money through affiliate
programes.<http://apnaapaisa.blogspot.com/2009/04/earn-money-through-affiliate-programes.html>
   - Earn money by Selling on
eBay<http://apnaapaisa.blogspot.com/2009/04/earn-money-by-selling-on-ebay.html>

looking for jobs ??
visit http://www.weeklyjobs.tk <http://www.weeklyjobs.tk%20>

--~--~---------~--~----~------------~-------~--~----~

3. Crash of emulator.exe on Windows Vista Ultimagte 64Bit

4. How to detect whether the virtual keyboard is visible or not? SDK 1.5

5. Crash of emulator.exe on Windows Vista Ultimagte 64Bit

6. com.android.ide.eclipse.ddms.views.LogCatView problems

7. com.android.ide.eclipse.ddms.views.LogCatView problems