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 add another status bar

hi,i want add a bar similar to the status bar that contain several
buttons
on the bottom of the screen.anyone can help me,thanks!

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. sdcard - remaining space

hello,

sorry if this has already been answered (hard to search for this
one)..
is there any way to detect remaining space on the sdcard through the
API? I prefer not to make native or shell calls.

Thanks!
--~--~---------~--~----~------------~-------~--~----~

3. Build Environment

4. Setting up UDP connections between devices

5. Updated to 1.5 and R.java is not regeneratated

6. Issue: Neither user 10039 nor current process has android.permission.WAKE_LOCK || Rooted Phone || App from SD card || JF image

7. Invoking one apk from another