Exploring Android P: Display Cutouts

Joe Birch
Joe Birch
Mar 9, 2018 · 5 min read
Image for post
Image for post

Image for post
Image for post
val params = window.attributes
params.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
Image for post
Image for post
Image for post
Image for post

container_connect.setOnApplyWindowInsetsListener { v, insets ->
val displayCutout = insets.displayCutout
// do stuff with display cutout

insets.consumeDisplayCutout
}

Exploring Android

Deep dives + how-to articles for the latest android…

Joe Birch

Written by

Joe Birch

Android Engineering Lead at Buffer, Google Developer Expert for Android & Flutter - Passionate about mobile development and learning. www.joebirch.co

Exploring Android

Deep dives + how-to articles for the latest android platform features

Joe Birch

Written by

Joe Birch

Android Engineering Lead at Buffer, Google Developer Expert for Android & Flutter - Passionate about mobile development and learning. www.joebirch.co

Exploring Android

Deep dives + how-to articles for the latest android platform features

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store