navigation-drawer

How to add checkbox to material navigation drawer?

混江龙づ霸主 提交于 2019-11-30 07:19:59
I use Menu items Icon Menu but I want to add checkbox to all menu item. This is my drawer_menu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="all"> <item android:checked="false" android:id="@+id/item_navigation_drawer_inbox" android:icon="@drawable/ic_inbox_black_24dp" android:checkable="true" android:title="Inbox" /> <item android:id="@+id/item_navigation_drawer_starred" android:icon="@drawable/ic_action_toggle_star" android:checkable="true" android:title="Starred" /> <item android:id="@+id/item

android.content.res.Resources$NotFoundException: String array resource ID #0x7f070002

回眸只為那壹抹淺笑 提交于 2019-11-30 07:19:47
I'm having problem getting a string array for strings.xml . The error is: android.content.res.Resources$NotFoundException: String array resource ID #0x7f070002 at android.content.res.Resources.getStringArray(Resources.java:472) at com.klh.lehava.MainActivity.onCreate(MainActivity.java:87) Basically what I'm trying to do is to get a string-array called planets_array , and store it into mPlanetTitles . This is one of google's examples for navigation drawer, and I downloaded it from their site and modified it. For some reason I don't get this error on Nexus 4 (android 5.0 lollipop), but I do get

Android Navigation Drawer on multiple Activities

故事扮演 提交于 2019-11-30 06:46:59
问题 Is there a way to configure only one time the Navigation Drawer, and the display it on multiple Activites? 回答1: For this just create a BaseActivity class that implements the drawer, and let all your other activities extend this one. 回答2: For people wanting an code example with Activities, take a look at my answer over here: https://stackoverflow.com/a/19451842/2767703 If you want a nice transition I would suggest this: When you click on an item in the NavigationDrawer close the navigation

Disabling navigation drawer, toggling home-button/up-indicator in fragments

陌路散爱 提交于 2019-11-30 06:13:24
问题 The setup I have an activity whose contentView is an instance of a DrawerLayout , which has a navigation drawer with a drawer indicator displayed in the action bar. The activity contains a Fragment , let's call it ListFragment , which contains a list of options. When an option is clicked, I replace the ListFragment with a DetailFragment . At this point, I would like to display an "up" navigation option instead of the navigation drawer indicator. I'm able to display the "up" icon if I disable

Android changing the width of the navigation drawer panel programmatically

夙愿已清 提交于 2019-11-30 05:27:36
I've used the Navigation Drawer template presents in Android Studio. In the layout of my activity I have this following code: <fragment android:id="@+id/navigation_drawer" android:layout_width="@dimen/navigation_drawer_width" android:layout_height="match_parent" android:layout_gravity="start" android:name="com.smedilepaolo.newsfeed.NavigationDrawer.NavigationDrawerFragment" tools:layout="@layout/fragment_navigation_drawer" /> What I need is to change programmatically the width of the panel. I think that the right zone to change it is this: @Override protected void onCreate(Bundle

Android, DrawerLayout + Fragments + CollapsingToolbarLayout

大城市里の小女人 提交于 2019-11-30 05:18:51
Is it possible to have a CoordinatorLayout / CollapsingToolbarLayout in the fragments shown in the main container of a DrawerLayout? An answer to another question suggests that each fragment could have its own Toolbar. But this doesn't work well with the ActionBarDrawerToggle as it requires a Toolbar to link to the open/close drawer behaviour. Has anybody achieved this, or do you have pointers about this? Thanks. EDIT : I've been focusing some efforts in putting a single Toolbar in the DrawerLayout , meant to stay there all the time, but was not able to get it to scroll (on a Nexus5 API 22).

Changing Navigation drawer hamburger icon

邮差的信 提交于 2019-11-30 05:09:21
I am trying to change hamburger menu icon for NavigationView but I am unable to do so. Here is what I have tried so far I have a base activity where nav drawer setup is done. Here is relevant piece of code @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setContentView(R.layout.activity_base_nav); setSupportActionBar(toolbar); setupDrawer(); } private void setupDrawer() { mDrawerLayout.setDrawerListener(this); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.open, R.string.close); mDrawerToggle = new

navigation drawer google maps v2 , map blocking drawer

坚强是说给别人听的谎言 提交于 2019-11-30 05:04:15
I have this problem when opening drawer on gingerbread and behind is google map v2. Map that should be on screen behind gets on top of everything. Now I could bypass this by hiding map when drawer opens and show it when closes but I'm looking for more elegant solution if someone came up with any? There is a bug with google maps api v2 and black space. Maybe you have got similar problem. For solutions look here: https://github.com/jfeinstein10/SlidingMenu/issues/228 and here: https://github.com/jfeinstein10/SlidingMenu/issues/168 As far as I remember solutions are one of this: extending Google

How to create mini-drawer menu in Android?

微笑、不失礼 提交于 2019-11-30 05:02:23
I am looking to create a mini-drawer menu like in google example: I have tried to create a layout that always stays there on ParentLeft, and the menu to overflow it when it opens, but it does not look natural. Does anyone know how do I do it? Update I have tried another way. To listen to menu sliding, and to catch when it is closed enough, then I can set menu size, and keep icons visible, but text to be gone. @Override public void onDrawerSlide(float v, int i) { Log.d("onDrawerSlide", "v=" + v + " i=" + i); if (i<previewsI && decreasingCount > 3) { // check if menu is closed enough if (i <100

Touch anywhere to slide open menu for navigation drawer

不打扰是莪最后的温柔 提交于 2019-11-30 04:55:26
For Sliding menu by jfeinstein10 ( https://github.com/jfeinstein10/SlidingMenu ), I can slide anywhere in the app to slide open the menu. For Google newly introduced navigation drawer http://developer.android.com/design/patterns/navigation-drawer.html#side-nav , is there any way I can have similar behaviour? So far, from documentation, I saw it only limit to slide from edge or touching the app icon. The user can bring the navigation drawer onto the screen by swiping from the left edge of the screen or by touching the application icon on the action bar. Maxim Efimov I have found a solution. You