navigation-drawer

ActionBarDrawerToggle No Suitable Constructor Drawable

老子叫甜甜 提交于 2019-11-27 16:59:55
问题 I have simple code to create simple navigation drawer, but when i declare parameter for ActionBarDrawerToggle it's say that drawable icon cannot be applied... Gradle Massages Build Error:(36, 26) error: no suitable constructor found for ActionBarDrawerToggle(MainActivity,DrawerLayout,int,int,int) constructor ActionBarDrawerToggle.ActionBarDrawerToggle(Activity,DrawerLayout,Toolbar,int,int) is not applicable (argument mismatch; int cannot be converted to Toolbar) constructor

Navigation drawer not opening from cutom menu button

落花浮王杯 提交于 2019-11-27 16:24:11
I'm working on an Android App, I have a navigation drawer over there. Since the navigation drawer toolbar can't be transparent, and the ending three dots button icon can't be changed, I opted for hiding that toolbar, and show my custom layout. It will give me all the functionality what ever is needed. But the problem I'm facing right now is, once the activity starts, if I click the custom menu button it doesn't open. Once I drag it and open, after that whenever I click the menu button it opens the navigation drawer. What might i be missing? This is what I'm doing, while debugging its even

Different toolbar for fragments and Navigation Drawer

匆匆过客 提交于 2019-11-27 16:14:27
问题 Please, explain to me... I have Navigation Drawer in my Activity and it syncs with Toolbar (like ActionBar ). Activity has few fragments and in different fragments I need to use different AppBar modes (parallax in one, simple in another). So, I think that I should set CoordinatorLayout in each frament with AppBar and content. But how I can replace last toolbar on new to save synchronization with Drawer? Or it's wrong way and I need make it some else? 回答1: If you are using DrawerLayout and

Android on Drawer Closed Listener

梦想的初衷 提交于 2019-11-27 15:46:31
问题 I have an application using navigation drawer that provides list of locations. In the drawer, there are several options (like choosing country, city, etc) that user can setup before showing the corresponding list in the main activity. Is there any possibility to refresh the list when user close the drawer, or maybe there is another way to solve this? I've tried to search for tutorials but found nothing about this drawer closed listener. Any suggestions would be helpful, thanks! 回答1: When you

Navigation Drawer closes on click

∥☆過路亽.° 提交于 2019-11-27 15:45:16
I have implemented a Navigation Drawer but I am having some trouble getting it to function properly. When I click on position 1 or 2, it is not launching the new fragment. MainActivity.java public class MainActivity extends Activity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; // nav drawer title private CharSequence mDrawerTitle; // used to store app title private CharSequence mTitle; // slide menu items private String[] navMenuTitles; private TypedArray navMenuIcons; private ArrayList<NavDrawerItem> navDrawerItems; private

Navigation Drawer Icon (ic_drawer) not showing

↘锁芯ラ 提交于 2019-11-27 15:38:19
问题 I am implementing a navigation drawer for my app. Now it works perfectly except for one small glitch. When I set the Navigation Drawer Icon (ic_drawer) to replace the regular "HomeAsUp" caret icon, I still get the arrow. The Nav Drawer icon does not show. I have implemented every method that was on the android developers website. But it doesn't seem to work. Below is my code: DrawerLayout mDrawerLayout; FrameLayout leftDrawer, rightDrawer, contentFrame; ActionBarDrawerToggle mDrawerToggle;

Reduce space between menu groups inside navigation drawer

三世轮回 提交于 2019-11-27 15:14:19
I want to reduce the space between each menu group in the Navigation drawer (In the following image, space between the two lines). I've created a custom style and tried the following attributes <item name="android:paddingTop">0dp</item> <item name="android:paddingBottom">0dp</item> They only reduced the padding around the items text. Even the following attributes didn't worked <item name="android:layout_marginTop">0dp</item> <item name="android:layout_marginBottom">0dp</item> I think you must override design_navigation_separator_vertical_padding dimens in your project dimes.xml <dimen name=

DrawerLayout must be measured with MeasureSpec.EXACTLY error

北战南征 提交于 2019-11-27 14:59:36
I am trying to implement a Navigation drawer, but I keep getting this error. I saw the similar questions but did not work for me. I have the following layout activity_main2.xml: <android.support.v4.widget.DrawerLayout android:layout_width="match_parent" android:id="@+id/drawerLayout" android:layout_height="match_parent"> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"/> <RelativeLayout android:layout_gravity="left|start" android:layout_width="match_parent" android:background="#fff" android:layout

Toolbar's shadow on status bar for Lollipop

放肆的年华 提交于 2019-11-27 14:57:45
问题 I'm using a template from Android Studio that used AppCompat Toolbar . Unfortunately, the toolbar casts shadow on the status bar so it doesn't look right.I also implement a NavigationDrawer so I can't simply set the color of the status bar. This is how it looks: This is how it should be: activity_main.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com

Android Navigation Drawer Fragment State

心已入冬 提交于 2019-11-27 14:04:19
问题 I'm currently utilizing the Navigation Drawer for my Android APP. In my first fragment, I've a fragment that loads data using Facebook's Graph API. Thus, when my App is first loaded, it first goes to the first fragment. Then, I use the Navigation Drawer to click on another Fragment and view it. And then finally, I reuse the Navigation Drawer to proceed back to the first Fragment and view it. My issue that I'm facing is, how do I proceed to utilize the Fragment that has been created once