Android open source -- SlideMenu, android -- slidemenu

Source: Internet
Author: User
Tags home screen

Android open source -- SlideMenu, android -- slidemenu

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

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;
Android slide menu Background Brightness and transparency settings

Without such an api, you can make the transparency by yourself. Just like the animation effect, you can define an xml file. To adjust the brightness, modify settings. For example, when you slide, you need to increase the brightness to 100, Settings. system. putInt (getContentResolver (), Settings. system. SCREEN_BRIGHTNESS, 100); After sliding, the brightness changes to 100 immediately, instead of gradually becoming brighter. You can adjust the value of 100 according to the sliding speed. If not, you may need to add the settings modification permission in AndroidManifest. xml, but 4.4 does not seem to require

What is the famous open-source framework for Android?

The application corresponds to the so-called framework. Try to write a game with a J2EE framework. Or you can write a search engine and try it with the game engine. No framework solves all the problems. If that is the case, it is too easy to build a computer. If the framework is used, it is a software. It is also useful to learn the basic design patterns.

Related Article

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.