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. ContentProvider design question!

I provide a free and paid version of my app.  I'm planning to have a
3rd app which is able to use the data from any of the two.  I want to
create a content provider to allow other apps to access their data.
Now how can I handle the case when the user has the two apps free and
paid installed?

What are the side effects when declaring the same contentProvider
uri?  Also, how can I tell if ContentProvider is available/exists?

Any design patterns would help!

Thanks!
-Moto

-- 

2. Google Maps with Navigation

Yuhuuuu..dah jalan lagi nih..

kalo Androidnya sdh di root, kita buang Gmaps yg ada di android...

pakai adb :
adb remount
adb shell find /system /data -name \*google\*maps.apk\* -o -name
Maps.apk -delete
adb uninstall com.google.android.apps.maps

pakai terminal :
mount -o remount,rw /system
find /system /data -name \*google\*maps.apk\* -o -name Maps.apk -delete
pm uninstall com.google.android.apps.maps

Download http://ul.to/dh1cbe/maps3.3.1-brut-root-3.apk

Install the new file:
adb install -r maps3.3.1-brut-root-3.apk
or
adb install -r maps3.3.1-brut-no-root-3.apk

Hajaaaaar....

-- 
--------------
"Indonesian Android Community [id-android]" 

3. Help with speech recognition

4. How to save variables, even when I close the APP

5. Google AdSense Account Status

6. Cyanogen 5.0.3 for N1 is out

7. How to get reference of (SQLiteDatabase) to use android contact database