drawerlayout

Android DrawerLayout (with NavigationView) behind status bar

放肆的年华 提交于 2019-12-01 08:50:46
问题 I have an app with a DrawerLayout that contains a NavigationView : activity_layout.xml: <?xml version="1.0" encoding="utf-8"?> <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:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/drawer_layout" android:fitsSystemWindows="true"> <android.support.constraint

DrawerLayout not working with Android 4.4 & SurfaceView

主宰稳场 提交于 2019-12-01 08:17:13
Today I had one of those "android" moments again, which left me absolutely clueless. I have an app which consists of a DrawerLayout, which includes a RelativeLayout as container for a SurfaceView (surfaceViewContainer) and a second ViewGroup (subclass of RelativeLayout) as navigation. When the app starts, in onCreate I inflate the layout and add a SurfaceView to the surfaceViewContainer. On a Samsung S2 with 4.1.2 and a S3 with 4.3 everything works fine, I can see the SurfaceView drawn and I can open and close the drawer, by swipe gesture or home button. Then I tested on Android 4.4 with a

How to close drawer menu when click on item menu?

寵の児 提交于 2019-12-01 07:32:34
问题 This is click event. view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { v.setBackgroundResource(R.color.colorTim); FragmentManager fragmentManager = ((AppCompatActivity)context).getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); HienThiSanPhamTheoDanhMucActivity hienThiSanPhamTheoDanhMucActivity = new HienThiSanPhamTheoDanhMucActivity(); Bundle bundle = new Bundle(); bundle

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

DrawerLayout prevents call of MainActivity.onTouchEvent()

可紊 提交于 2019-11-30 23:34:50
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 transmit the TouchEvent to the MainActivity: // onTouchEvent of CustomDrawerLayout @Override public

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

Transition in navigation drawer android

强颜欢笑 提交于 2019-11-30 14:37:39
Anyone having idea that how to achieve this type of transition. When we open Navagation drawer full screen is getting animation like this. I also looked at reside menu but here menu is predefined not as i want. I also tried with NavigationDrawer but not got succeed. drawer.addDrawerListener(new DrawerLayout.DrawerListener() { @Override public void onDrawerSlide(View drawerView, float slideOffset) { float moveFactor = (linearLayout.getWidth() * slideOffset); float min = 0.9f; float max = 1.0f; float scaleFactor = (max - ((max - min) * slideOffset)); if (Build.VERSION.SDK_INT >= Build.VERSION

Android Toolbar + Tab Layout + Drawer, Hide toolbar when scrolling and take TabLayout to the top

半腔热情 提交于 2019-11-30 12:33:36
问题 I have activity which has drawer attached to it. Each menu of the drawer is a fragment, and under one of the menu I have a fragment with TabLayout , and each tab contains a RecyclerView . So now, when I scroll the RecyclerView , tab layout is getting hidden but ToolBar remains at the top. What I need is to ToolBar to get hidden( scrollFlags:scroll|enterAlways ), and TabLayout should get shown at the top. So current setup is: Activity with attached DrawerLayout -> Fragment with TabLayout ->

vertical DrawerLayout or SlidingPaneLayout

我与影子孤独终老i 提交于 2019-11-30 10:33:56
问题 The latest Android Support Library introduced the DrawerLayout to implement the common UX pattern where you slide right or left to show a navigation menu. What I'd love to have is a vertical DrawerLayout with the same API, that can be pulled down/up from the top/bottom of my layout. Since 4.2 the old SlidingDrawer has been deprecated and I haven't heard about some new Widget that implements the same functionality. Can the DrawerLayout be extended somehow to implement the vertical swipe UX

Collapsing Toolbar and DrawerLayout

房东的猫 提交于 2019-11-30 07:43:08
I created a layout with parallax effect which I use in a fragment. <android.support.design.widget.CoordinatorLayout 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.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar" android:layout_width="match