navigation-drawer

Is it possible to slide open/closed a navigation drawer in uiautomator

一世执手 提交于 2019-12-13 01:27:59
问题 Has anyone been able to pull this off. UiScrollable, swipeLeft and swipeRight do not appear to have any affect on it. I am using a Nexus 5 emulator with the latest api. Has anyone been able to pull it off? 回答1: TL;DR : Use the content descriptions set in the ActionBarDrawerToggle constructor When you set up your Navigation Drawer, set an ActionBarDrawerToggle with content descriptions for opening and closing. // Open drawer content description for accessibility private static final String

Multiple checkable groups in NavigationDrawer stopped working after upgrading support design library

心不动则不痛 提交于 2019-12-13 01:04:27
问题 I am using NavigationView to display menu.xml data to my NavigationDrawer. It had two groups of checkable items. The first group could have any number of items checked at the same time, the second one could have only one checked. Support library versions used: compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.0' xml code used for NavigationView <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns

How to create a navigation drawer on a fragment in android

时光毁灭记忆、已成空白 提交于 2019-12-13 00:43:29
问题 I need some suggestions in my design. I have an Activity class that loads multiple fragments. One of the fragment has Navigation drawer. When the user clicks any of the items in the navigation list it loads its fragments and has a back button to come back to the Fragment with the navigation Drawer. As shown in the image. A,B, C are items in navigation drawer which would replace the content and has a back button to go back to Fragment D with navigation drawer. I have seen multiple tutorials

Setting a margin for NavigationDrawer items

半世苍凉 提交于 2019-12-12 16:20:16
问题 My problem is that I can't correctly set up the margin in my navigation drawer. I have tried changing margin of any view and item but it doesn't seem to work out. All I get is space between the ActionBar and NavigationDrawer (and the beginning of the page). I think that the problem is inside my ListItem layout but I am not sure. This is a photo of what I get And this is my layout and code files. Main Layout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk

DrawerLayout opens kind of in steps the first time

廉价感情. 提交于 2019-12-12 13:10:37
问题 I have a DrawerLayout which the first time when I swipe it, it is coming in steps(like lag or something similar), but after that it moves fine. I don't know what code to post, because as I said it's working fine, only the first time when I open it, it doesn't open smoothly. This is my layout: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/DrawerLayout" android:layout_width="match_parent

3 line icon is not animating into a smaller image in Navigation Drawer

故事扮演 提交于 2019-12-12 12:09:40
问题 The small icon(indicator or 3 line) beside the logo, is not changing into a smaller one. --> this image is not animating, When I click the apps' logo the drawer is opened but the image is not animated into a more smaller image which is an indicator that the drawer is currently opened. gABar.get().setDisplayHomeAsUpEnabled(true); mDrawerToggle = new ActionBarDrawerToggle( getActivity(), /* host Activity */ mDrawerLayout.get(), /* DrawerLayout object */ R.drawable.ic_drawer2, /* nav drawer

How to add subitems in a Navigation Drawer

蹲街弑〆低调 提交于 2019-12-12 10:26:40
问题 I want to add subitems in my navigation drawer but i am not able to execute it because i have no idea about the logic , i have tried some examples but i am able to display only the items. i have tried the following code : package com.example.demo_data1; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView

Android TabHost only inside one Fragment (NavigationDrawer)

喜你入骨 提交于 2019-12-12 09:18:47
问题 I'm currently coding an application that uses a lot of Fragments accessible using a Navigation Drawer. So far so good, but I also want to have a TabHost with 2 Tabs inside one of the Fragments. How do I best implement it? This is a code snippet: public class SectionFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { int position = getArguments().getInt("position"); if (position == 0) { rootView = inflater

EditText inside of a DrawerLayout

爷,独闯天下 提交于 2019-12-12 08:55:29
问题 I've been trying to set an EditText box inside of a DrawerLayout, but reading carefully through the Android Training Website, they explain that the DrawerLayout is allowed to have only two child views. If I would like to do something like the next code, How should I approach it? <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"> <!-- The

SeekBar in a NavigationDrawer

巧了我就是萌 提交于 2019-12-12 08:22:12
问题 I want to use a seekbar in a Navigation Drawer Basically I need to slide left and right to set the seekbar and, well, you guessed it, it slides the navigation drawer... What I would like to do is to slide the seekbar when it's focused and the navigationdrawer when it's not. How should I do that? Here is my code when setting an item (I haven't set the seekbar yet) private View onCritereView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View mView = inflater.inflate