Android card flip animation

The card flipping effect has been used in recent projects. After a general study, and referring to some online demos, the simple implementation is as follows:

activity_ main.xml

As you can see, two layouts are used

activity_ card_ back.xml

activity_ card_ front.xml

Attach a custom image: shape_ card_ back_ bg.xml

shape_ card_ front_ bg.xml

The main logic is as follows:

Use some animation resources:

anim_ left_ in.xml

anim_ right_ out.xml

Attribute animation is used. For compatibility, don't forget the following configuration:

The renderings are as follows:

design sketch:

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
分享
二维码
< <上一篇
下一篇>>