Android custom animation like airport schedule board

。_饼干妹妹 提交于 2019-11-27 02:52:42

问题


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?

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) findViewById(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();
}

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

Thanks, AndroidVogue


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/7315486/android-custom-animation-like-airport-schedule-board

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!