[Android] Youku ring menu – rotate animation

Get the house, menu icon, ImageView object, and get three torus relativelayout objects

Set the click event for the menu icon (icon_menu)

Define a member variable islevel3show to store whether the third level menu is displayed

Judge the above variables to display and hide the third level menu, and define a class to realize the animation effect

Switch variables, islevel3show =! isLevel3Show

Define a tool class myutils to realize rotation animation

Define a startanimout()

Get the rotateanimation object. The default center of the rotation object is the upper left corner, and the starting degree is 0 degrees horizontally to the right by default, and turn clockwise; Constructor: start degree, end degree, center x (half width), center y (height)

Call the setduration() method of the rotateanimation object to set the execution time. Parameter: Ms

Call the setfillafter() method of the rotateanimation object to set the state to be maintained after execution. Parameter: Boolean value

Define a startanimin(), parameter: relativelayout object, delay Ms

Like the above, the degrees are different, from 180 degrees to 360 degrees

Call the setstartoffset() method of the rotateanimation object to delay playback

Set the click event for the icon_home

Judge whether to hide the secondary menu when it is displayed, and hide it when the tertiary menu is also displayed

When it's hidden, let it show

MainActivity.java

MyUtils.java

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