Android open-source -- SlideMenu
Introduction:This SlideMenu is no longer a new technology. It is mainly used to switch between the left, right, and right pages. The left and right pages are generally used as the setting pages.
The source code of SlideMenu references another open-source framework ActionBarSherlock. The main Activity of the application must inherit SlidingFragmentActivity.
This Activity is inherited from SherlockFragmentActivity. It mainly implements a FragmentActivity with a header ActionBar;
Main API details:
SlidingMenu sm = getSlidingMenu (); // initialize Slidemenusm. setSlidingEnabled (true); sm. setMode (SlidingMenu. LEFT_RIGHT); // set the mode for dragging the left and right of the master node. // set the drag range. TOUCHMODE_FULLSCREEN indicates that the full screen TOUCHMODE_MARGIN indicates that the sm is valid only when dragging around the main screen. setTouchModeAbove (sregistringmenu. TOUCHMODE_MARGIN); sm. setShadowWidthRes (R. dimen. shadow_width); sm. setShadowDrawable (R. drawable. shadow); sm. setBehindOffsetRes (R. dimen. slidingmenu_offset); // sets the visible width of the sliding rear main module sm. setBehindScrollScale (0.5f); // determines the sm of the blocked object based on the sliding volume. setFadeEnabled (true); // sets the gradient mode sm for conversion. setFadeDegree (0.8f); // set the Left and Right blocked page setBehindContentView (R. layout. left_menu_frame); getsuppactionactionbar (). setDisplayHomeAsUpEnabled (true); getsuppfrfragmentmanager (). 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 home screen // getSlidingMenu (). showMenu (); // display the menu page // getSlidingMenu (). showSecondaryMenu (); // displays Level 2 menus
Tip: You need to leave an email address for the source code;