navigation-drawer

Navigation Drawer not working

旧巷老猫 提交于 2019-12-05 07:28:25
问题 I combined navigation drawer with tabs layout. In that tab, the layout is working properly for three tabs but navigation drawer is misbehaving. The navigation drawer icon disappeared, it is opening by sliding by not getting closed by sliding. And also the menus in navigation drawer are not working. <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayoutxmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns

Permanent NavigationView loose focus after an item is selected

耗尽温柔 提交于 2019-12-05 06:53:30
I started a project with a Navigation Drawer from the basic template of Android Studio. The only modification I made was to display it as permanent in order to have a tablet/TV layout. To achieve this, the only modification I made was in the xml layout. This allow the NavigationView to be always visible. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <android.support.design

How to customise Navigation Drawer item height

好久不见. 提交于 2019-12-05 05:36:22
问题 Hello guys I'm trying to change the height of my Navigation Drawer items and I don't know how, I've looked everywhere and did my best but nothing seems to work.. This is my Navigation Drawer item which is customised to have a text under that image but also I want that image to be a little bigger. The result I am looking up to is this: With around 75dp of height for each item and also I want the menu to be shorter on the width to give that look in that image. I am using a custom layout for my

Updating a fragment in response to Android Navigation Drawer interaction

爷,独闯天下 提交于 2019-12-05 04:56:43
The Android app I'm working on has a single MainActivity and each screen of the app is implemented as a Fragment. Each fragment is instantiated like this in the MainActivity as a private class variable: public class MainActivity extends Activity implements MainStateListener { private FragmentManager fm = getFragmentManager(); private BrowseFragment browseFragment = BrowseFragment.newInstance(); ... There is a single 'fragment frame' that loads each screen fragment. When switching screens in the app this code is called to load a fragment: FragmentTransaction ft = fm.beginTransaction(); ft

DrawerLayout and Multi Pane Layout

核能气质少年 提交于 2019-12-05 03:11:43
My application uses a Multi Pane layout to display a list of assignments. Each Assignment can be put in one AssignmentCategory . I want to use a DrawerLayout to display all the AssignmentCategories so the user can switch easily between the diffirent categories. I didn't manage to create such a layout. In the official DrawerLayout tutorial the DrawerLayoutActivity replaces a Fragment when a user clicks on a item (in my case an AssignmentCategory ). The problem I facing is that a Multi Pane layout requires a FragmentActivity . I don't know how to create a Fragment which contains a Multi Pane

Don't display the overlay with the Android Navigation Drawer

拥有回忆 提交于 2019-12-05 03:00:42
I was wondering if it's possible to remove the automatic overlay made by the recently implemented Navigation Drawer ? (The grey layer on the second picture) hardartcore You just need to set setScrimColor(int color) to your DrawerLayout : mDrawerLayout.setScrimColor(Color.WHITE); // OR mDrawerLayout.setScrimColor(Color.TRANSPARENT); Here is the official documentation from Android API: DrawerLayout - setScrimColor() . Hope this solves your problem! : ) 来源: https://stackoverflow.com/questions/18129598/dont-display-the-overlay-with-the-android-navigation-drawer

Navigation Drawer icon not showing android

荒凉一梦 提交于 2019-12-05 01:55:21
问题 MainActivity.java public class MainActivity extends FragmentActivity { public DrawerLayout mDrawerLayout; public ListView mDrawerList; public ActionBarDrawerToggle mDrawerToggle; // nav drawer title public CharSequence mDrawerTitle; // used to store app title public CharSequence mTitle; // slide menu items public String[] navMenuTitles; public TypedArray navMenuIcons; public ArrayList<NavDrawerItem> navDrawerItems; public NavDrawerListAdapter adapter; ActionBar actionBar; TextView tvTitle,

Android Navigation Drawer Show Up Indicator for Lower Level Fragments

旧城冷巷雨未停 提交于 2019-12-05 01:09:16
I have some issues switching navigation drawer functionality to up functionality at lower level fragment . I have read this thread to manage to show the up indicator. But when pressing the button, it'll open up the navigation drawer instead of going back to previous fragment. And I can't set action bar title in EditUserFragment to "Edit Profile". I'm using the navigation drawer template available in Android Studio. I have three levels: MainActivity with navigation drawer that consists of Home and Profile items UserFragment titled with "Profile" that has an option item that'll bring up

What's the purpose of tools:openDrawer=“start” when creating a DrawerLayout (with NavigationView) from the wizard?

大城市里の小女人 提交于 2019-12-04 23:15:46
Creating an activity with navigation drawer in Android Studio causes this to be shown in the XML code: <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/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:openDrawer="start"> If I remove the tools:openDrawer="start" , on the layout preview, the navigation drawer will be closed instead of open. I thought this

Navigation Drawer and VideoView in android

人盡茶涼 提交于 2019-12-04 22:45:39
I am using a navigation drawer plus a tablayout. I have a video in my tab which was not visible at first, but I can hear the sound. Once I set video_view.setZOrderOnTop(true); and I can also see the video, but this causes an issue with navigation drawer. When I slide it, the video doesn't hide behind the navigation drawer as do all other elements. If I don't use video_view.setZOrderOnTop(true); then my drawer is works fine. main_activity.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width=