Android Open Source--slidemenu

Source: Internet
Author: User

Open Source Address: Https://github.com/jfeinstein10/SlidingMenu

Introduction: the Slidemenu is no longer a new technology. The main is to achieve the left-right three pages of the switch. Two pages in general as Settings page


Slidemenu Source references Another open source framework actionbarsherlock. The main activity of the app must inherit slidingfragmentactivity.

The activity inherits from Sherlockfragmentactivity. The main realization of a head with a actionbar fragmentactivity;


Main API Details:

Slidingmenu sm = Getslidingmenu ();//Initialize slidemenusm.setslidingenabled (TRUE); Sm.setmode (slidingmenu.left_right);// Set the main left and right drag mode//set the range of drag Touchmode_fullscreen refers to the full screen touchmode_margin refers to only the main screen around the drag is effective sm.settouchmodeabove ( Slidingmenu.touchmode_margin); Sm.setshadowwidthres (r.dimen.shadow_width); Sm.setshadowdrawable ( R.drawable.shadow); Sm.setbehindoffsetres (r.dimen.slidingmenu_offset);//Set the visible width of the slide's rear module Sm.setbehindscrollscale ( 0.5f);//The Object Sm.setfadeenabled (True) based on the sliding amount, or//set the gradient mode of the conversion sm.setfadedegree (0.8f);// Set the left and right occlusion page Setbehindcontentview (r.layout.left_menu_frame); Getsupportactionbar (). Setdisplayhomeasupenabled (True) ; Getsupportfragmentmanager (). BeginTransaction (). Replace (R.id.left_menu_frame, New Navigationfragment ()). Commit () ; Sm.setsecondarymenu (R.layout.right_menu_frame); sm.setsecondaryshadowdrawable (R.drawable.shadow); Getsupportfragmentmanager (). BeginTransaction (). Replace (R.id.right_menu_frame, New Settingfragment ()). commit (); Getslidingmenu (). Showcontent ();//Display the main screen//getslidingmenu (). ShowMenu ();//Display Menu page//GETSLIdingmenu (). Showsecondarymenu ();//Display Level 2 menu 


Tip: Need to leave the source code mailbox;

Android Open Source--slidemenu

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.