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