Navigation menu for drawer effectlooking at a lot of applications, I think this slippery drawer effect of the menu is very good.
Do not have to switch to another page, also do not have to press the menu hardware button, directly in the interface of a button click, the menu slide out, and feel able to put a lot of things.References to libraries:First of all, Drawerlayout this class is in the support libra
the navigation drawer indicator. Dismissing the navigation drawerWhen the navigation drawer are expanded, the user can dismiss it in one's four ways:
Touching the content outside the navigation drawer
Swiping to the left anywhere on the screens (including edge swipe from right)
Touching the app Icon/t
anywhere in your app by swiping from the left edge of the. Dismissing the navigation drawerWhen the navigation drawer are expanded, the user can dismiss it in one's four ways:
Touching the content outside the navigation drawer
Swiping to the left anywhere on the screens (including edge swipe from right)
Touching the
On the day of Google Io, the Android team updated the support library and added several more important features to the support library of the new version (V13).Adds a drawerlayout control that supports the creation of Navigation drawer mode. Can be set from the left side of the menu or the right side, can also left the menu to exist.Add Slidingpanelayout controls to support the summary, detail interface mod
!
Mercury
Venus
Earth
Mars
Jupiter
Saturn
Uranus
Neptune
Open navigation drawer
Close navigation drawer
Web search
Sorry, there\'s no web browser available
Finally, the main acti
NavigationDrawer navigation drawer) is a panel that transitions from the left edge of the screen and displays the main navigation operations of the app.
Show Navigation Drawer
You can slide the slider from the left edge of the screen or click the icon on the ActionBar of the app to display the Navigation
Google updated its Google + app in July this year, adopting a new approach to navigation and abandoning navigationdrawer. In the moment, there is a series of discussions about the pros and cons of Navigationdrawer, but for developers we just have to take care of what we need to achieve or learn, 2012 YouTube, Facebook, Path and other applications have used navigationdrawer such a way of navigation, last year Google in order to rectify the increasingly
Overview
In the past, ActionBar was unique to Android 4.0. Later, ActionBarSherlock's dedicated-step martial arts, and SlidingMenu, however, this can be a good fit for Android 4.0. Since the Google I/O conference (last year, this year will begin in a few days ).
According to zhihu daily, Douban applications obviously feel the style of Android Design.Effect
Public
Android uses Drawerlayout to simulate the drawer mode of Netease news client, scaling androidlayout
I personally feel that Netease's client is more avant-garde and has a lot of new things. Sometimes I can learn a lot by imitating these good clients.
At the beginning of today's main topics, the following are the effects of Netease client drawer mode implementation
newconfig) {Super. onconfigurationchanged (Newconfig); Mdrawertoggle.onconfigurationchanged (Newconfig); } @Override Public BooleanOnoptionsitemselected (MenuItem Item) {//Pass the event to Actionbardrawertoggle, if it returns//true, then it has handled the app icon touch event if(mdrawertoggle.onoptionsitemselected (item)) {return true; }//Handle your other action bar items ... return Super. onoptionsitemselected (item); }} The more tangled is
throughout the UI navigation drawer.
(3) The drawer view (the ListView above) must specify its horizontal gravity and the android: layout_gravity attribute. Supports the right-to-left language (RTL), specifying the value and "start" instead of "Left" (the layout is RTL in the right drawer ).
(4) The
, the browser will be called to open the Baidu homepage.Full code:public class Mainactivity extends Activity implements Onitemclicklistener {private Drawerlayout mdrawerlayout;private ListView mdrawerlist;private arraylist6. Add an icon in the upper left corner to open the drawer when the user taps the iconAdd code in Mainactivity's OnCreate method:Turn on Actionbar app icon function Getactionbar (). Setdis
Drawerlayout (drawer layout), often appearing in various apps, such as CSDN.Points:1. When using Drawerlayout, in the XML layout, put the layout of the main interface in front, then put the layout contents of the drawer behind2. Remember to add android:layout_gravity= "left" or "start" to the layout in the drawer to indicate which side the
The navigation Drawer (navigationdrawer) is a panel that slides in from the left side of the screen to display the main navigation items for your app. Users can open the navigation drawer by sliding into the left edge of the screen or by touching the app icon on the action bar.The navigation
An slidingdrawer class is also called a "drawer" class. It is easy to use, including handle, and content. Handle. When you click it, content is either drawn from the drawer or closed from the drawer. This is the result of pulling the drawer up and down. Set the slidingdrawer attribute to
fragment = new ContentFragment (); Bundle bundle = new Bundle (); bundle. putString ("title", (TextView) view ). getText (). toString (); fragment. setArguments (bundle); mFm. beginTransaction (). replace (R. id. fl_containor, fragment ). commit (); mDrawerLayout. closeDrawer (Gravity. LEFT );}});}
A ListView is used to render the drawer menu and set the click event for replacing the content view on the right after clicking.
Complete code:
Package
Navigationview is very important in MD design, before Google also proposed using Drawerlayout to implement the navigation drawer. This time, in the Android Design Support Library, Google provided the Navigationview to implement the navigation menu interface.This time we wrote the code in Android with Tablayout to achieve similar netease tab dynamic sliding effect
In this folder management app, we can try to reference some new elements, here I give a blow to introduce a drawer called the layout, QQ used to the drawer layout, notThey also on the original basis of their own development of the new drawer layout, and quite tall on the, by the way, classification management, these ar
The slidingdrawer hides content outside the screen and allows you to drag a handle to display hidden content.It consists of two sub-views: one is the handle dragged by the user, and the other is the content that changes with the drag ). Slidingdrawer should be used as the overwrite of the internal layout, that is, the slidingdrawer should use the framelayout or relativelayout layout internally. The size of slidingdrawer determines the space occupied when the content is displayed. Therefore, its
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.