navigation-drawer

Navigation Drawer lag on Android

核能气质少年 提交于 2019-11-27 19:26:29
I'm having a problem with Navigation Drawer , it is too slow, the solution I'm looking for is to close the drawer first and then show the activity, but It is not working, certainly I'm missing something. private class DrawerItemClickListener implements ListView.OnItemClickListener { @Override public void onItemClick(AdapterView<?> parent, View view, int posicao, long id) { setLastPosition(posicao); setFragmentList(lastPosition); layoutDrawer.closeDrawer(linearDrawer); } } private OnClickListener userOnClick = new OnClickListener() { @Override public void onClick(View v) { layoutDrawer

dynamic adding item to NavigationView in Android

安稳与你 提交于 2019-11-27 18:50:55
I want to build NavigationDrawer with the possibility of adding new items (such as yahoo weather App with adding new cities). I have working NavigationDrawer with NavigationView , in menu I have permanent fields: <group android:id="@+id/group" android:checkableBehavior="single"> <item android:checked="false" android:id="@+id/item1" android:icon="@drawable/ic_inbox_black_24dp" android:title="Item1" /> <item android:checked="false" android:id="@+id/Item2" android:icon="@drawable/ic_inbox_black_24dp" android:title="Item2" /> </group> I'm trying to add new Item this method: public boolean

Android KitKat: android.view.InflateException: Error inflating class android.support.design.widget.NavigationView

时光总嘲笑我的痴心妄想 提交于 2019-11-27 18:45:56
问题 Below is my configuration. This works on Android Lollipop but crash on Android Kitkat. I tried every workaround here but can't help: Error inflating class android.support.design.widget.NavigationView build.gradle android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 14 targetSdkVersion 23 // Support RenderScript Library v8 renderscriptTargetApi 18 renderscriptSupportModeEnabled true } } ext{ supportLibVersion = '23.1.1' } dependencies { compile fileTree(dir:

Fullscreen navigation drawer

我们两清 提交于 2019-11-27 18:25:39
问题 I have a navigation drawer like this. What I want to do is open my drawer to fullscreen not half screen. How do I make this drawer to open as full screen? This is xml of drawerlayout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows=

How to implement a DrawerLayout with a visible handle

点点圈 提交于 2019-11-27 18:09:54
I have successfully implemented a NavigationDrawer for my application. My app displays a drawer that opens on the left of the screen. My problem is I need to add a button on the left. That button might be clicked or swiped to open the left drawer. That I can do. But the button is supposed to look like it's a part of the drawer that would overflow into the screen. That means the button should slide simultaneously as the drawer opens and closes. CLOSED STATE : OPENING STATE I tried adding the button into the left drawer's layout, but it seems you can't make stuff appear outside of its boundaries

Android NavigationView menu group divider [duplicate]

烂漫一生 提交于 2019-11-27 18:04:43
This question already has an answer here: How to create a simple divider in the new NavigationView? 13 answers Android support design library provide NavigationView: <android.support.design.widget.NavigationView ... app:menu="@menu/navigation_drawer_items" /> menu/navigation_drawer_items: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item .../> ... </group> <group android:checkableBehavior="single"> <item .../> ... </group> </menu> How to add divider, separator or space between groups (like on picture)? Moinkhan Just give a unique

How to reset the Toolbar position controlled by the CoordinatorLayout?

我怕爱的太早我们不能终老 提交于 2019-11-27 17:48:59
The app I'm working on consists of a Navigation Drawer which is implemented in an Activity. The activity layout is as follows: <FrameLayout 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:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinator"

How to overcome this item padding in navigation drawer?

谁说胖子不能爱 提交于 2019-11-27 17:37:07
问题 I check out all the question and also google a lot I just want to remove this padding between each item in navigation view. Help me to sort out this problem thanks in advance. This is the code of my main_drawer <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single" android:id="@+id/home1" > <item android:id="@+id/home" android:title="Home" /> </group> <group android:checkableBehavior="single" android

Why does DrawerLayout sometimes glitch upon opening?

落爺英雄遲暮 提交于 2019-11-27 17:27:44
I have followed the tutorial Navigation Drawer and everything works like a charm except for a small glitch. I'll try to explain it as much as possible, and if it still isn't clear, I'll try to upload a video of the problem. Problem happens when trying to open the drawer and only when opening, and only happens sometimes, not always. That is when I start to open it it glitches and freezes with about 4 millimeters open, and always the same distance. It then would not continue opening nor close back if I move my finger back, when I let go, it closes. Please note: I have tried it on multiple

Optimizing drawer and activity launching speed

时间秒杀一切 提交于 2019-11-27 17:04:58
I'm using the Google DrawerLayout . When an item gets clicked, the drawer is smoothly closed and an Activity will be launched. Turning these activities into Fragment s is not an option. Because of this, launching an activity and then closing the drawer is also not an option. Closing the drawer and launching the activity at the same time will make the closing animation stutter. Given that I want to smoothly close it first, and then launch the activity, I have a problem with the latency between when a user clicks on the drawer item, and when they see the activity they wanted to go to. This is