开发者

Android custom animation like airport schedule board

开发者 https://www.devze.com 2023-04-02 10:22 出处:网络
I want to create an animation for the text like on Airport the flight schedule board does. Dropping from top and change the text on it. Here is the image. So When I click on button the text on the ima

I want to create an animation for the text like on Airport the flight schedule board does. Dropping from top and change the text on it. Here is the image. So When I click on button the text on the image should change with the said animation. Does it possible with android?

Android custom animation like airport schedule board

Please guide me how can I achieve this kind of animation in android?

EDIT:

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">
    <item android:drawable="@drawable/clockbg1" android:duration="150" />
    <item android:drawable="@drawable/clockbg2" android:duration="150" />
    <item android:drawable="@drawable/clockbg3" android:duration="150" />
    <item android:drawable="@drawable/clockbg4" android:duration="150" />
    <item android:drawable="@drawable/clockbg5" android:duration="150" />
    <item android:drawable="@drawable/clockbg6" android:duration="150" />
</animation-list>

My Activity Class:

public class XMLAnimation extends Activity {
private static AnimationDrawable animation;
private ImageView refresh;

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.main);

    refresh = (ImageView) fi开发者_运维技巧ndViewById(R.id.simple_anim);
    refresh.setBackgroundResource(R.drawable.loader_animation);
    animation = (AnimationDrawable) refresh.getBackground();
}

@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    animation.start();
}

Android custom animation like airport schedule board

Android custom animation like airport schedule board

Android custom animation like airport schedule board

Android custom animation like airport schedule board

Android custom animation like airport schedule board

Android custom animation like airport schedule board

Now How to place vertically animated text on this images so it looks like the animation I wanted to create?

Thanks, AndroidVogue


It isn't exactly the thing you want, but there's a nice 3-part tutorial by Kevin Dion that starts here for creating a custom odometer widget that looks something like what you want. It should help get you started.

To get the effect of the top half of the letters falling down (if that's what you want), you can fake it by drawing the letter into a buffer image and then scaling the vertical extent of the letter to get a foreshortening effect.


I got working library. Originally developed by someone else but I provided support for down version from Froyo. I hope this can help you out.

AbhanFlipView

Ref:

Library Developed By: Emil Sjölander Animations Created By: Jake Wharton

UPDATE

It has a document named HowTo.txt shows how to integrate.

Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消