drawerlayout

How to create drawer navigation like this?

北慕城南 提交于 2019-12-23 00:24:04
问题 Hi guys, I wanna create the drawer navigation. I have read some docs, but it didnt work, so I will show u the picture that I want my drawer layout to look like this. Hope you can spend some to help me :) 回答1: You must make an ExpandableListView in your NavigationDrawer ExpandableListView : here NavigationDrawer : here Example : <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent"

How to disable drawer option in specific fragments of an activity

独自空忆成欢 提交于 2019-12-21 21:34:38
问题 I have an activity with 5 fragments, I used drawer layout in my activity for a drawer, but I want to use(enable) the drawer in only fragment 2 and I want to disable the drawer option in remaining fragments. Can any one help me how to do this? 回答1: Put two methods in the your activity , one to disable the drawer and one to enable it again, like so: public void lockDrawer() { drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } public void unlockDrawer() { drawerLayout

Horiziontal recyclerview on DrawerLayout

落花浮王杯 提交于 2019-12-21 05:29:47
问题 This is my NavigationView 's layout <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" app:headerLayout="@layout/header" app:menu="@menu/meny" /> headerLayout has a horizontal RecyclerView which has some items that user can scroll on it. My problem is whenever I want to scroll in RecyclerView , drawerLayout is going to close . Is there any way to support horizontal

Gestures not working when using DrawerLayout in Android app

杀马特。学长 韩版系。学妹 提交于 2019-12-21 04:00:08
问题 I have an Android app with a single Activity. This activity uses this layout: <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 main content view --> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- The navigation drawer --> <ListView android:id="@+id/left

How to open NavigationDrawer only on first app start?

帅比萌擦擦* 提交于 2019-12-21 02:07:09
问题 Per Google guidelines, it is recommended you open the DrawerLayout the first time only after app is installed and opened (to show user the functionality). How would you go about doing this? It seems it would be a combination of openDrawer() method with some type of preference. 回答1: I would recommend that you use the SharedPreferences for that: The basic idea is that you read the SharedPreferences and look for a boolean value that doesn't exist there at first app start. By default, you will

Disable animation of drawer icon in double navigation drawer for right drawer

纵饮孤独 提交于 2019-12-20 19:46:39
问题 I have a Double Navigation Drawer I have two problems. 1) The navigation drawer icon on the left (3 bars) animate when opening or closing the navigation drawer on the right. 2) I do not know how to add the icon to the right and have it animate only for the right drawer. 回答1: You need to override the onDrawerSlide method of ActionBarDrawerToggle and set the slideOffset to 0 if the drawer is right drawer. So this would disable the animation of the navigation drawer image for right drawer.

How to set Navigation Drawer icons to the right side of the Item Texts?

妖精的绣舞 提交于 2019-12-20 05:23:31
问题 My Project Screenshot: My Project My Target Design: My Target I have created a (right to left) navigation drawer. It's working fine but when I'm trying to move the icon from the left side to the right side, it's not working. <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"

Xamarin.Android : Gravity parameter in DrawerLayout.LayoutParams

a 夏天 提交于 2019-12-20 05:20:22
问题 I'm trying to create a DrawerLayout programmatically using Xamarin.Android , but I faced a problem when trying to add the ListView which should be dragable form the left .. Here is my code : DrawerLayout myDrawerLayout = new DrawerLayout(this); myDrawerLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); SetContentView(myDrawerLayout); FrameLayout myFrameLayout = new FrameLayout(this); myFrameLayout.LayoutParameters =

DrawerLayout prevents call of MainActivity.onTouchEvent()

可紊 提交于 2019-12-19 03:57:27
问题 I have an app that overrides the onTouchEvent(MotionEvent ev) of the MainActivity to determine Two-Finger-Swipe and Pich-Open / Pinch-Close . Everything works fine until I add the DrawerLayout to the app (like it's described in Creating a Navigation Drawer). Problem: the DrawerLayout prevents the call of onTouchEvent() in the MainActivity. I started to write a CustomDrawerLayout , and try to override the DrawerLayout methods onInterceptTouch() and onTouchEvent() . The only way (I found) to

Android DrawerLayout is not working with ViewPager?

不问归期 提交于 2019-12-18 20:08:31
问题 I have implemented ViewPager inside a DrawerLayout it is working properly but Drawer menu list view not displaying properly with the action bar it will display below the ViewPager tabs.Hope following figure will give you an idea. And i am using actionbarsherlock library. How can i display the Drawer menu list view exactly below the action bar?? What i have tried. Activity OnCreate(): setContentView(R.layout.activity_layout); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);