navigation-drawer

(Android) Navigation drawer with Multi-pane layouts

狂风中的少年 提交于 2019-12-06 00:42:52
I have a hard time trying to come with a good and acceptable layout for an activity for a tablet , but I'm not sure that if my design is compatible with Google's design guidelines. In short: my application receives a network sniffer log file and shows statistics on different features on the data. For example, traffic over time, PM over time, show the traffic as a time line, different graphs, pie charts etc. The first thing comes to mind for a design for this activity is a multi-pane layout (like Gmail's for tablets). The first pane would be the different features specified above, the second

Navigation drawer does not close when calling closeDrawers - timing issue

狂风中的少年 提交于 2019-12-05 22:10:15
I am trying to close the navigation drawer when an item in the navigation drawer's list is clicked. I have 2 activities A and B. The below code is the same for both A and B: final DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); ListView mDrawerList = (ListView) findViewById(R.id.left_drawer); // Set the list's click listener mDrawerList.setOnItemClickListener(new OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> arg0, View v, int position, long arg3) { Intent intent = null; // first just close the drawer mDrawerLayout.closeDrawers(); if

Ripple effect on custom navigation drawer

Deadly 提交于 2019-12-05 22:01:12
问题 I'm developing my first app providing to it the new material look. I'm a bit lost with this so I'm following some tutorials to implement things like Toolbar, Navigation Drawer, etc. I have to say that I'm doing it providing compatibility to pre-lollipop android versions, so I'm using support libraries. What concers to my question, is that I have just implemented the Navigation Drawer following one of this tutorials and using the following libraries for compatibility: support.v4.widget

Android Google Play navigation drawer style

ε祈祈猫儿з 提交于 2019-12-05 21:28:55
There is any tutorial or code how to make the navigation drawer listview will be show like Google Play or Google Play Music Navigation Drawer? I want my Nav Drawer look like this: Can you help me with this? Thanks Haim. EDIT:I know how to build navigation drawer, I want a style for the navigation drawer that my nav drawer will look like the google play navigation drawer(big listview tabs....). If you can write the code. EDIT2:I used this: https://www.youtube.com/watch?v=9WeQzZUroAs Rohit Goswami Yes you can use navigation drawer like facebook on one or both side,try this : Android - Is

Navigation Drawer and with Activity in Android

你。 提交于 2019-12-05 19:55:47
I am trying out the navigation drawer (slide menu) given in this tutorial. The difference with above link and mine is that instead of calling fragments I am trying to call the activity. When the app opens I am not able to see the Navigation drawer menu I can see only the action bar with HOME activity opened. Here is the code that I changed: (Is it necessary to have a fragment or can I use activity for my first screen in Navigation Drawer?) mTitle = mDrawerTitle = getTitle(); navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items); navMenuIcons = getResources().obtainTypedArray

Open navigation drawer when options menu button is pressed

五迷三道 提交于 2019-12-05 19:52:57
问题 I'd like the navigation drawer opened when the options menu button is pressed. So in my Sherlock Fragment activity I added: @Override public boolean onCreateOptionsMenu(Menu menu) { if (!mDrawerLayout.isDrawerOpen(mDrawerLinear)) { mDrawerLayout.openDrawer(mDrawerLinear); } return true; } For some reason nothing happens when the options menu button is pressed. Otherwise the drawer is working fine. It opens when the app icon on the action bar is pressed or when I pull it. So what's wrong? 回答1:

How to set an Observer to Update Navigation Drawer after onActivityResult method's received an Intent result

依然范特西╮ 提交于 2019-12-05 18:17:00
In my app I want to update the Navigation Drawer with the username's nickname and email after he's logged in. From my MainActivity I am starting a LoginActivity with the startActivityForResult(intent, PICK_ACCOUNT_REQUEST); method to get the users registered or logged in. After the LoginActivity returns the Intent data result (his NAME and EMAIL ) back to MainActivity , the method onActivityResult() is called and there I try to update the class' global variables NAME and EMAIL with the newly received data, with no success: after every registration or log the two fields never show in the

Update selected state of navigation drawer after back press

别来无恙 提交于 2019-12-05 14:46:27
问题 Whats the proper way to handle the selected state of the navigation drawer after back press? I have a navigation drawer with n entries (in a listview) like the SDK sample in Android Studio. When i click on the navigation drawer entries i want them to be added to the back stack, so i can move back to them. In onNavigationDrawerItemSelected(int pos) i have FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction transaction = fragmentManager.beginTransaction(); if

Get Toolbar's navigation icon view reference

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 13:47:11
问题 I would like to highlight drawer icon in my Toolbar (working on a tutorial). For that, I need its position. How do I get a reference to drawer's navigation icon (hamburger) view? 回答1: You can make use of content description of the view and then use findViewWithText() method to get view reference public static View getToolbarNavigationIcon(Toolbar toolbar){ //check if contentDescription previously was set boolean hadContentDescription = !TextUtils.isEmpty(toolbar

How to change color of text and icon of Sub-Menu attached to Navigation view?

て烟熏妆下的殇ゞ 提交于 2019-12-05 13:44:29
I am trying to figure out how I can change color of sub-menu items which is actually attached to navigation view. Following codes are actually from default template of Navigation Drawer which is available in android studio. activity_main_drawer.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/nav_camara" android:icon="@android:drawable/ic_menu_camera" android:title="Import" /> <item android:id="@+id/nav_gallery" android:icon="@android:drawable/ic_menu_gallery" android