navigation-drawer

ActionView set to an item in support NavigationView not showing

牧云@^-^@ 提交于 2019-12-01 09:37:10
问题 I'm using the support NavigationView in my navigation drawer to display menu of items. <android.support.design.widget.NavigationView android:id="@+id/drawer_navigation" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:background="@drawable/drawable_background" app:headerLayout="@layout/drawer_header" app:itemBackground="@drawable/drawer_item_background" app:itemIconTint="@color/drawer_item" app:itemTextColor="@color/drawer_item"

Navigation bar hides but leaves space when using navigation drawer in android 5+

孤街醉人 提交于 2019-12-01 09:20:35
I am trying to develop a full-screen app with 2 main activities: LoginActivity and DashboardActivity. LoginActivity has only the UI for user input to login like Username and password. In this screen the nav and status bar gets hidden completely without leaving any space. After login in the DashboardActivity I have a toolbar with Navigation drawer. In this activity I did all things I did in LoginActivity. What happens is the Nav and status bar gets hidden but the space occupied by Nav bar before hiding alone stays. This happens only in Android 5+. It works fine in Kitkat. Here are the snapshots

Fixed navigation header in navigation drawer while scrolling through items

戏子无情 提交于 2019-12-01 08:44:07
问题 CURRENT STATE : NavigationDrawer with a NavigationHeader and NavigationMenu items. The items are large in number so scrolling is required in order to access the items towards the bottom. REQUIREMENT : When scrolling down to the bottom, the NavigationHeader should stay fixed Here's my activity_main layout file <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

Can't click the buttons behind the DrawerLayout

 ̄綄美尐妖づ 提交于 2019-12-01 05:12:30
问题 here is my xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".Main" android:background="@android:color/black" > <RelativeLayout android:id="@+id/layout" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageButton android:id="@+id/calendar" android:layout_width="wrap_content" android:layout_height="wrap

How to rectify NullPointerException in v4.DrawerLayout? [duplicate]

孤街浪徒 提交于 2019-12-01 02:55:42
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 4 months ago . I am trying to implement a navigation drawer but for some reasons am getting this null pointer exception . I have spent a lot of time on it but in vain. This is a part of my code. I can't understand why it is returning null pointer exception. Do I need to import any library or so? Thanks in advance. package com.motobeans.productions.aloha; import android.app

Remove App Icon from Navigation Drawer ActionBar Does not work

一曲冷凌霜 提交于 2019-12-01 02:03:39
I am working on an App which has design requirement to be built as it should only have the Title on the ActionBar and not the App Icon. i tried various solutions found from StackOverflow like getActionBar().setDisplayUseLogoEnabled(false); getActionBar().setDisplayShowHomeEnabled(false); getActionBar().setIcon(null); however none of these worked so far, even i tried to make a hack/fix by making a transparent ic_launcher icon and put it into manifest.xml but it causes the App installation icon make transparent. please help getActionBar().setDisplayShowHomeEnabled(false); works perfectly in 4.4

Navigation Drawer - Divider between sections like Gmail App

两盒软妹~` 提交于 2019-12-01 01:26:22
I am updating the Navigation Drawer in my app. I want to add section dividers as the Gmail App has. How do I add them? Just add them as views, which is a simple approach. But, i want to know, is it the correct approach? Gmail App: Right now, I am using a listview with a header view. My current xml: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android

how to implement navigation drawer without action bar but opens the navigation screen with a button on main screen?

只谈情不闲聊 提交于 2019-12-01 01:06:26
navigation drawer app that have login screen on its left_drawer fragment (see link: how to show a activity(login screen) under android navigation drawer ), I want to open this login screen from the main screen using a button and also don't want the action bar on navigation drawer. Can any one please help me with this? Thanks In advance!! It's quite simple actually. Easier than with ActionBar. I'm writing the answer with almost simplest of layouts make your xml something like this: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@

Android Status Bar transparent with Navigation Drawer - Appbar elevation

随声附和 提交于 2019-12-01 00:19:22
I am working on an app with Material Design Guidelines. I have a boilerplate app created by Android Studio. For some reason the status bar has a little gradient at the bottom which creates an illusion of Appbar (Toolbar) being on a higher elevation than status bar. I took a look on Chris Bane's Cheesesquare app for reference and it doesn't look like he is doing anything special to achieve that. Here are the screenshots for reference - Boilerplate app Cheesesquare app Notice that Cheesesquare app's status bar and app bar feel like on the same elevation with just different shades of purple.

DrawerLayout on top of Actionbar

守給你的承諾、 提交于 2019-11-30 20:19:39
When using the drawer layout is there a way to overlay the drawer view over the action bar? I do not want to hide the action bar when the drawer is shown. I want the action bar to simply stay put, but be sent to the background. An example of this is the iOS Play Music app... My current implementation hides and shows the action bar when the drawer state changes, but I do not like this user experience. public void onDrawerClosed(View view) { getActionBar().show(); invalidateOptionsMenu(); } public void onDrawerOpened(View drawerView) { getActionBar().hide(); invalidateOptionsMenu(); } I searched