Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google's NavigationDrawer not drawing correctly over map

I'm having this issue with Google's NavigationDrawer not drawing correctly over the map when I pull it out from the side of the screen, it's being drawn under the map instead of over it, when closing it from already being open it is shown correctly.

The first picture is closing it, the second pic is opening it. This is occurring on a Galaxy S3 running 4.1 but on my Galaxy nexus 4.2 there's no issue. I had a similar issue with a ViewPager and Map a while ago that could be fixed by putting the map inside a FrameLayout with another framelayout over it, but that was on pre-ICS devices. If I had to guess this has to do with hardware acceleration.

Here's a video of the bug in action on YouTube.

like image 563
Dennis Avatar asked Jun 06 '13 10:06

Dennis


1 Answers

Just using DrawerLayout.bringChildToFront(View) didn't work for me, although I added a DrawerLayout.requestLayout() call and it did it!

Here's the code

ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(...) {      @Override     public void onDrawerSlide(View drawerView, float slideOffset) {         super.onDrawerSlide(drawerView, slideOffset);         drawerLayout.bringChildToFront(drawerView);         drawerLayout.requestLayout();     }      ... }  drawerLayout.setDrawerListener(drawerToggle); 


Hope this helps

like image 87
Nivaldo Bondança Avatar answered Sep 28 '22 07:09

Nivaldo Bondança