Android implements custom sliding drawer effect menu
In Andoird, the components built in Android, such as slidingdrawer and drawerlayout, are drawer effect menus. However, many functions to be implemented in the project are limited by the built-in components of Android, which makes it difficult to complete the requirements of the project. All aspects of customized components are under their own control, so they can be adjusted according to the needs. In order to achieve good results, basically, the ontouch event based on Android implements its own response function. First of all, let's take a look at the overall effect:
There are acceleration effects of sliding. You can only view the specific experience after installation. Next, look at the code: the code extends two classes from mainactivity: maincontroller and mainview. Maincontroller handles the control layer and mainview operates the presentation layer. Main code: Code of mainactivity:
Maincontroller Code:
Code of mainview:
Log management class mylog:
The core class to achieve animation effect is openlooper:
Reprinted from: http://blog.csdn.net/qxs965266509
Source download: drawer effect
The above is the whole content of this article. I hope it will be helpful to your study.