Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

SurfaceView rendering with NavigationDrawer and statusbar #5738

Closed

Description

@tobrun

update: reopened to investigate issues related to nav drawer and snackbar.

original:
Feedback from latest SNAPSHOT indicates that we are seeing the same bug with SurfaceView as mentioned in #2244 (comment).

Next actions:

  • add example to TestApp with an NavigationDrawer
  • reproduce issue on multiple android versions
  • look into setZorderOnTop or related Android SDK methods.
  • revert back to TextureView if issue still exists

Activity

  1. added
    Android
    on Jul 20, 2016
  2. added this to the android-v4.2.0 milestone on Jul 20, 2016
  3. tobrun commented on Jul 21, 2016

    @tobrun
    MemberAuthor

    First tests show that I'm not able to reproduce an rendering artefact when I have the basic Navigation Drawer setup (cfr. Android Studio Acitivity creation wizard) on Android N or KitKat.

  4. tobrun commented on Jul 21, 2016

    @tobrun
    MemberAuthor

    I tried converting the standard Navigation Drawer setup with a translucent statusbar. My focus here is to recreate the same experience as Google maps exposes on that Platform.

    Android Nougat:

    device-2016-07-21-132457

    Android Lollipop:

    screen shot 2016-07-21 at 13 29 05

    Android KitKat:

    image

  5. tobrun commented on Jul 21, 2016

    @tobrun
    MemberAuthor

    The NavigationDrawer itself isn't an issue but the status bar is:

    ezgif com-video-to-gif 16

    ezgif com-video-to-gif 17

  6. tobrun commented on Jul 21, 2016

    @tobrun
    MemberAuthor

    I have been trying out some things to get the desired result. With a couple of window flags I was able to show NavigationDrawer correctly but you can see it clipped at the bottom.

    ezgif com-video-to-gif 18

  7. tobrun commented on Jul 21, 2016

    @tobrun
    MemberAuthor

    Progress update: I was able to get it working on Android N without issue from #5738 (comment). It boils down brining the navigation drawer to front while doing the animation:

    update: also not seeing an issue on Lollipop!

      @Override
      public void onDrawerSlide(View drawerView, float slideOffset) {
            mDrawerLayout.bringChildToFront(drawerView);
            mDrawerLayout.requestLayout();
       }

    ezgif com-video-to-gif 19

  8. tobrun commented on Jul 21, 2016

    @tobrun
    MemberAuthor

    Looking at testing with KitKat now and seeing that the animation is not occurring full width:

    ezgif com-video-to-gif 20

    Hiding the SurfaceView is showing the animation:

    ezgif com-video-to-gif 21

    update:

    a workaround for this would be to disable the scrimcolor:

    if (android.os.Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
            mDrawerLayout.setScrimColor(Color.TRANSPARENT);
    }

    This results in following UX:

    ezgif com-video-to-gif 22

  9. added 3 commits that reference this issue on Jul 21, 2016
  10. bleege commented on Jul 22, 2016

    @bleege
    Contributor

    Seeing similar issues when testing on Samsung S5 running API 21

    device-2016-07-22-110043

    device-2016-07-22-110214

  11. added 2 commits that reference this issue on Jul 23, 2016
  12. tobrun commented on Jul 26, 2016

    @tobrun
    MemberAuthor

    We have reverted back to TextureView #5765. Reopening this as I create a separate branch to track down clipping issues with NavDrawer and Snackbar with SurfaceView.

  13. reopened this on Jul 26, 2016
  14. tobrun commented on Jul 26, 2016

    @tobrun
    MemberAuthor

    I have been searching the web to find some hints on how to resolve this. After trying a couple of things I came across this http://stackoverflow.com/questions/20373529/navigationdrawer-under-mapfragment-and-cameraview-surfaceview.

    That SO answer indicates to add a transparent background color on a overlain layout. We already have a markerViewContainer layout there so I adjusted mapview_internal.xml to:

    <?xml version="1.0" encoding="utf-8"?>
    <merge xmlns:android="http://schemas.android.com/apk/res/android">
    
        <SurfaceView
            android:id="@+id/surfaceView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    
        <FrameLayout
            android:id="@+id/markerViewContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clickable="false"
            android:background="@android:color/transparent"/>
    
        ....
    
    </merge>

    This does not only solve our issue on older devices it also remove the requirement that a user needs to work around this issue themselves as with #5738 (comment) or #5738 (comment)


    Before

    ezgif com-video-to-gif 54

    After

    ezgif com-video-to-gif 55

  15. self-assigned this
    on Jul 26, 2016
  16. tobrun commented on Aug 3, 2016

    @tobrun
    MemberAuthor

    #5804 was merged into the development branch of SurfaceView. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Androidbug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions