Android custom control viewfipper to achieve vertical running light effect

I've always wanted to achieve the effect of a vertical running lamp. Today, I came into contact with the viewflipper control, which is used for Android view switching and packaged with custom controls; Realize its click callback and custom view functions

Not much to say, go directly to the code:

Defines a custom control that inherits LinearLayout

How to animate viewflipper:

in.xml

out.xml:

Let's take a look at the layout_ How to write the viewflipper layout:

Among them, flipinterval determines the switching time

Let's look at the code in mainactivity:

By the way, an interface is also defined:

At this point, the above vertical running lamp is completed.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>