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.