Android-menudrawer and Slidingmenu usage

Source: Internet
Author: User

Project Address:

Https://github.com/gokhanakkurt/android-menudrawer Https://github.com/jfeinstein10/SlidingMenu Android-menudrawer usage:
    protectedmenudrawer Mdrawer;/**Pass in the current activity's layout file*/    protected voidInitmenu (intLayoutmain) {Mdrawer= Menudrawer.attach ( This, Menudrawer.menu_drag_content,position.right);        Mdrawer.settouchmode (Menudrawer.touch_mode_fullscreen);        Mdrawer.setcontentview (Layoutmain);        Mdrawer.setmenuview (r.layout.menu_sample);        Mdrawer.setdropshadow (R.drawable.shadow); Mdrawer.setdropshadowsize ((int) getresources (). Getdimension (R.dimen.shadow_width)); Mdrawer.setmaxanimationduration (3000); Mdrawer.sethardwarelayerenabled (false); Mdrawer.setmenusize ((int) getresources (). Getdimension (R.dimen.slidingmenu_offset)); }mdrawer.togglemenu (); Automatically determine whether to open or close the status in the activity OnCreate method to add Mdrawer.peekdrawer () at the end; apply under Viewpager Onpagechangelistener Event onpageselected method, add the Mdrawer.settouchmode (index= = Fragments.size ()-1?MenuDrawer.TOUCH_MODE_FULLSCREEN:MenuDrawer.TOUCH_MODE_NONE); 

Slidingmenu usage
New Slidingmenu (this);        Menu.setmode (slidingmenu.right);        Menu.settouchmodeabove (slidingmenu.touchmode_fullscreen);        Menu.setshadowwidthres (r.dimen.shadow_width);        Menu.setshadowdrawable (R.drawable.shadow);        Menu.setbehindoffsetres (r.dimen.slidingmenu_offset);        Menu.setfadedegree (0.35f);        Menu.attachtoactivity (this, slidingmenu.sliding_content);        Menu.setmenu (r.layout.menu_sample);

Menu.toggle (); Method automatically determines whether the state is open or closed

Apply under the Viewpager control

In the Onpageselected method

Menu.settouchmodeabove (Index = = fragments.size ()-1
? Slidingmenu.touchmode_fullscreen
: Slidingmenu.touchmode_none); Because I'm showing on the right, so the total minus 1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.