Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translucent navbar for Android 10 #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 29, 2020

  1. Fix translucent navbar for Android 10

    When the status bar is _not_ hidden, past behavior was for the
    navigation bar to be translucent. On Android 10 (SDK 29), it is opaque
    black. This patch restores and improves upon past behavior by ensuring a
    fully transparent nav bar when gesture controls are enabled (and
    using the system-provided translucent scrim when 3-button navigation
    is enabled).
    
    To achieve this we need to switch from using
    android:windowTranslucentNavigation to using android:navigationBarColor.
    On Android 10, it appears android:windowDrawsSystemBarBackgrounds
    must be set for android:navigationBarColor to have any affect.
    (I wonder if this is related to being an AlertDialog.)
    android:windowDrawsSystemBarBackgrounds is not supported in SDK < 21,
    whereas this library supports SDK >= 19, so I've created a separate
    styles.xml file for SDK >= 29.
    
    Setting systemUiVisibility flags appears to be necessary to get
    the transparent nav bar effect. It seems that setting
    android:windowTranslucentNavigation was providing the same effect
    as setting these flags, but now it needs to be done manually for
    SDK >= 29 as android:windowTranslucentNavigation is not set.
    svank committed Mar 29, 2020
    Configuration menu
    Copy the full SHA
    27c248e View commit details
    Browse the repository at this point in the history