Hi I am working with android. I added android navigation drawer as in g mail to my app successfully.Now I want to add a profile picture view as in the image . I tried it in list item. but I want more space as just like in the image..How can I do this ??? Please help me I am new to android
here is my code for list item
mTitle = mDrawerTitle = getTitle();
// load slide menu items
navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items);
// nav drawer icons from resources
navMenuIcons = getResources()
.obtainTypedArray(R.array.nav_drawer_icons);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.list_slidermenu);
navDrawerItems = new ArrayList<NavDrawerItem>();
// adding nav drawer items to array
// Home
navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));
// Find People
navDrawerItems.add(new NavDrawerItem(navMenuTitles[2], navMenuIcons.getResourceId(2, -1)));
// Photos
navDrawerItems.add(new NavDrawerItem(navMenuTitles[3], navMenuIcons.getResourceId(3, -1)));
// Communities, Will add a counter here
navDrawerItems.add(new NavDrawerItem(navMenuTitles[4], navMenuIcons.getResourceId(4, -1), true, "22"));
// Pages
navDrawerItems.add(new NavDrawerItem(navMenuTitles[5], navMenuIcons.getResourceId(5, -1)));
// What's hot, We will add a counter here
navDrawerItems.add(new NavDrawerItem(navMenuTitles[6], navMenuIcons.getResourceId(6, -1), true, "50+"));
// Recycle the typed array
navMenuIcons.recycle();
mDrawerList.setOnItemClickListener(new SlideMenuClickListener());
// setting the nav drawer list adapter
adapter = new NavDrawerListAdapter(getApplicationContext(),
navDrawerItems);
mDrawerList.setAdapter(adapter);
Firstly I'd say you need to rank your information in order of importance. The users name being, presumably, the most important and therefore what they need to see to tell them
a) they are logged in and
b) which account they're logged in with.
for more follow this link https://ux.stackexchange.com/questions/44776/navigation-drawer-with-my-account-entry
I Also Solve this Problem.Just Modify some of Code in XML And Java.
Change code follow below code...... I think solve your problem
And Java code Just Added below code::::
final boolean drawerOpen = mDrawerLayout.isDrawerOpen(drawerll);
here drawerll means Total linear Layout. and mDrawerLayout.closeDrawer(drawerll);
and close Drawer Layout....
Here Total Java Code:
I Think this would Solve your Problem:
I've just modified this sites code: http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
You can also use a custom View in NAvigatindrawer not only a listvew. So create a LinearLayout with your pic and a listview and you get the result.
Have a look at this SO Thread: Is it possible to use something other than a listview as sliding drawer in drawerlayout
Have fun ;)
I solved this by using
where you need to add a View object
Just for your information you can Use FB parse which gives you a very easy way how to add those apis and fetch the details easily , they have simple documentation step by step have a look
You can read about this here : https://www.parse.com/docs