Dark theme & gesture navigation (Google I/O'19)

Android Developers · 43K views · 2019 · 41:20

Open on YouTube

Software (other)UX & UI designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it as the reference for edge-to-edge layouts, gesture exclusion, and dark theme behavior on Android Q.

Recommended by 0 people across 0 different months, 2019 to 2019.

What it is

A Google I/O 2019 session from the Android team on Android Q's dark theme and gesture navigation. Chris Banes, Nick Butcher and Rohan Shah show how to support dark theme, handle system gestures, and draw edge-to-edge with window insets so apps work with the new system UI.

What people said

Cites Murat · 2019-05 · Stack Overflow · on “How to reserve left side of activity in Android Q for gestures”

You should NOT use systemGestureExclusionRects api for Navigation Drawer or any other controls which would result in opting out the whole left/right edge as this will result inconsistent behavior. DrawerLayout has out of box support for system gestures. All you need to do is update the dependency to '1.1.0-alpha01' and build against Q. You can refer to this devbyte [LINK] and this I/O session [this video] for more details.

Cites android developer · 2019-06 · Stack Overflow · on “Is it possible to have a night-qualifier for splash screen on Android?”

Background I know there is a new feature on Android Q to finally support dark theme (wrote here [LINK] about detecting it). I also know that there is "Night Light" feature ( here [LINK] ) that makes the screen become more yellow-ish. Supporting the theme choosing manually is something I've done for years (using simply setTheme [LINK] on Activity's onCreate's first line of code), but I want to know if there is something automatic that will allow me to set it even before the app really starts, in the splash screen. The problem It seems a very old feature (since API 8!) has existed on Android for a very long time, of having "night" qualifier in the resources, and I never even tried it. Sadly, b

Cites hardysim · 2019-07 · Stack Overflow · on “Go edge-to-edge on Android correctly with WindowInsets”

I'm trying to get edge-to-edge ( [this video] ) working correctly on API 21 up to 29. I'm using this on my v27\themes.xml : <item name="android:windowLightNavigationBar">true</item> <item name="android:navigationBarColor">@android:color/transparent</item> And this in my Activity: override fun onWindowFocusChanged(hasFocus: Boolean) { super.onWindowFocusChanged(hasFocus) if (hasFocus) { window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE } } Plus, I'm setting android:fitsSystemWindows=true on my AppBarLayout . With that in place, it looks fine on API >= 27 where the content scrolls behind the now transparent navigation bar but on ol