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. How to find Key Performance parameters of an Android application

Hi Folks,

I am looking to find out the aunch latencyof an application by writing
an Android Java Application. For instance, when we launch a Browser, I want
to know how long it takes to the application to come to the ui and ready to
take an URL. The Logcat message prints the required information. But I am
looking to get this information programmatically.
01-06 22:11:24.059: INFO/ActivityManager(922): Displayed activity
com.android.browser/.BrowserActivity: 1678 ms

Also, is there a way to find the current LINUX and JAVA memory usage, CPU
usage of an application/task from Java layer?

I appreciate if you can provide some pointer on the same.

FYI, currently I am not looking to use db shell topor db shell
cat/proc/meminfocommands. I want the same information on the embedded
side, if possible from Java layer, at real time.

Regards,
-Arun

-- 

2. Android 2.0 Installation

Hi

I am trying to install the android 2.0. when i start the setup then it start
fatching...

i am using windows OS .. but when fetch it gives this error

Failed to fetch URL
http://dl-ssl.google.com/android/repository/repository.xml, reason:
dl-ssl.google.com

tell me how i resolved it... Please

-- 
Ali Murtaza

BCSF06M021
Research Assistant
Data Virtulization Ware House
PUCIT, Lahore, Pakistan
ali.murt...@pucit.edu.pk

-- 

3. Question regarding Dev Phone 2

4. media player....

5. Push technique in android

6. files and updating

7. PVPLayer:general question