You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Android DrawerLayout, MapView, button with top margin and translucent statusbar glitch. #1894
This is a pretty complex issue, but i think i have broken it down pretty well now.
I want to have a MapView with a DrawerLayout with a transparent StatusBar and with a settings button with top margin in a framelayout over the map.
What happens is when i open the drawer, an area at the top, equal to the top button margin is not grayed out until after the drawer is completely opened.
I have an activity with the following layout:
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/drawer_layout"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"
>
<FrameLayoutandroid:id="@+id/layout_map"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"
>
<com.mapbox.mapboxgl.views.MapView
android:id="@+id/map_view"android:layout_width="match_parent"android:layout_height="match_parent"
/>
<!-- <View android:layout_width="match_parent" android:layout_height="match_parent" android:background="#00f" />-->
<ImageButtonandroid:id="@+id/view_hamburger"android:layout_gravity="start|top"android:layout_width="48dp"android:layout_height="48dp"android:layout_marginTop="40dp"android:layout_marginStart="40dp"android:background="#f00"
/>
</FrameLayout>
<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/drawer_header"app:menu="@menu/drawer"
/>
</android.support.v4.widget.DrawerLayout>
Hi @erf! My suspicion is that the GL canvas is not aligned right or interacts in a strange way with the transparent status bar. I am aware that Mapbox is working on a Material Design sample app that should encounter this issue.
@bleege This may be related to the TextureView vs SurfaceView issue I mentioned this morning about animated layouts. Will be interesting is GLSurfaceView also has the same problem.
Thanks for the screenshot and example @erf. Super helpful!
We're going to be redoing the TestApp's UI to make it more compatible with Material Design / Navigation Drawers. We'll keep this in mind as it get's built out soon. The details on this and to follow along please see #1856.
@bleege At this stage it is a hunch. Until @erf can provide us an example app that recreates this issue (I wasn't able to on my phone) there is no way to prove this bug is fixed.
Also this bug appears to be related to the Android layout system so I'm thinking it might be a bug in the Android platform, or the layout has just not been set up correctly.
I don't think it has much to do with MapView other than SurfaceView is a special case when it comes to Android layout as it directly draws to the screen instead of being composited like all other View. TextureView states it behaves just like a normal View.
Hooked up TextureView via #2244 and #2293 this afternoon.
I'm going to close this issue for now as it looks like @tobrun@ljbade are confident that it fixes this issue. That said @erf please feel free to try the latest code out and reopen if you're still seeing issues.
Activity
hallahan commentedon Jul 15, 2015
Hi @erf! My suspicion is that the GL canvas is not aligned right or interacts in a strange way with the transparent status bar. I am aware that Mapbox is working on a Material Design sample app that should encounter this issue.
#1856
Could you by any chance provide a screen shot of this problem on your phone?
ljbade commentedon Jul 28, 2015
@bleege This may be related to the
TextureViewvsSurfaceViewissue I mentioned this morning about animated layouts. Will be interesting isGLSurfaceViewalso has the same problem.erf commentedon Aug 6, 2015
erf commentedon Aug 6, 2015
See example here: https://github.com/erf/mapbox-drawer-glitch
bleege commentedon Aug 6, 2015
Thanks for the screenshot and example @erf. Super helpful!
We're going to be redoing the TestApp's UI to make it more compatible with Material Design / Navigation Drawers. We'll keep this in mind as it get's built out soon. The details on this and to follow along please see #1856.
ljbade commentedon Sep 3, 2015
I have not seen this in our current TestApp which now uses a DrawerLayout.
@erf Do you mind seeing if you can modify the TestApp UI to reproduce this and stick a branch with it up on GitHub?
ljbade commentedon Sep 3, 2015
Hmm did some testing with transparent status and navigation bars and I can't find any issue with
MapView.It is posible this is a bug in Android or the support libs.
@erf What happens when you replace:
with
Do you get the same no shading while the drawer is opening?
ljbade commentedon Sep 4, 2015
We are pushing
TextureViewto0.2.0so we should wait to fix this bug then?@bleege ?
1 remaining item
ljbade commentedon Sep 5, 2015
@bleege At this stage it is a hunch. Until @erf can provide us an example app that recreates this issue (I wasn't able to on my phone) there is no way to prove this bug is fixed.
Also this bug appears to be related to the Android layout system so I'm thinking it might be a bug in the Android platform, or the layout has just not been set up correctly.
I don't think it has much to do with
MapViewother thanSurfaceViewis a special case when it comes to Android layout as it directly draws to the screen instead of being composited like all otherView.TextureViewstates it behaves just like a normalView.ljbade commentedon Sep 5, 2015
@erf Do you mind recreating the bug against the
TextureViewimplementation in https://github.com/mapbox/mapbox-gl-native/tree/2244-texture-view branch?I would like to know if this is a solution.
tobrun commentedon Sep 6, 2015
@ljbade I'm happy to report that I was able to get the correct behaviour using your branch 👍
Code in forked branch
ljbade commentedon Sep 7, 2015
@tobrun Excellent!
Hopefully we can get this fix into
0.1.0/cc @bleege
bleege commentedon Sep 8, 2015
Very cool. Thanks for running at this @ljbade @tobrun. Yep this is important so let's bolt #2244 into
0.1.0ASAP. 👍bleege commentedon Sep 9, 2015
Hooked up TextureView via #2244 and #2293 this afternoon.
I'm going to close this issue for now as it looks like @tobrun @ljbade are confident that it fixes this issue. That said @erf please feel free to try the latest code out and reopen if you're still seeing issues.
Great job everyone!
erf commentedon Sep 10, 2015
Sorry for the late reply, I can confirm that this is fixed using mapbox-gl-native commit 532bbd5
Test repo her: https://github.com/erf/mapbox-drawer-glitch
Great work!
bleege commentedon Sep 10, 2015
Awesome! Thanks @erf!