Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Display Cutout
Search
Panini
April 13, 2018
Programming
1
650
Display Cutout
Panini
April 13, 2018
Tweet
Share
More Decks by Panini
See All by Panini
Kotlin 1.5 preview
panini
1
450
Java谷園から逃げ出した話
panini
0
380
Kotlin 1.4-rc
panini
0
240
Fixing Broken Robots - Android Mutation Testing
panini
0
200
Kotlin Multiplatform
panini
2
660
build.gradle.kts
panini
2
2.4k
Kotlin Multi-platform(?)
panini
1
740
Convert Java file to Kotlin file ⌥⇧⌘K
panini
0
1.1k
Introducing Android P
panini
2
840
Other Decks in Programming
See All in Programming
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
5
7.8k
Module Harmony
petamoriken
2
510
Flutterアプリ運用の現場で役立った監視Tips 5選
ostk0069
1
500
Duke on CRaC with Jakarta EE
ivargrimstad
0
160
Micro Frontendsで築いた 共通基盤と運用の試行錯誤 / Building a Shared Platform with Micro Frontends: Operational Learnings
kyntk
0
110
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
150
FlutterKaigi 2025 システム裏側
yumnumm
0
1.2k
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
460
flutter_kaigi_2025.pdf
kyoheig3
1
350
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
180
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
0
220
モビリティSaaSにおけるデータ利活用の発展
nealle
0
570
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Designing for Performance
lara
610
69k
Writing Fast Ruby
sferik
630
62k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Designing for humans not robots
tammielis
254
26k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Transcript
Introducing DisplayCutout Shibuya.apk #24
About Me • Matthew Vern / Panini • Twitter: @callipan
Github: panpanini • Mercari, Inc • Android Engineer (US) • Kotlin可愛い
Display Cutout support For devices like Essential Phone, or iPhone
X which have a cutout in the display (for camera, etc).
Display Cutout emulator Access from Developer options
Display Cutout emulator Mode: None - standard
Display Cutout emulator Mode: Narrow display cutout
Display Cutout emulator Mode: Tall display cutout
Display Cutout emulator Mode: Wide display cutout
Display Cutout emulator Cutout only covers status bar, so there
should be little affect to apps not using Fullscreen Activity
None
Important Point Status bar height has changed!
Important Point Clock has moved!
Important Point Clock has moved! Notifications only show on the
left
Important Point Clock has moved! Notifications only show on the
left Notifications will be hidden behind ..
LAYOUT_IN_DISPLAY_CUTOUT_MODE There are three layout modes for handling the cutout
in a fullscreen Activity: LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
LAYOUT_IN_DISPLAY_CUTOUT_MODE DEFAULT NEVER ALWAYS
WindowInsetListener // API Level 20+ view.setOnApplyWindowInsetsListener { view, windowInsets ->
val cutout: DisplayCutout? = windowInsets.displayCutout // Adjust view position based on cutout windowInsets.consumeDisplayCutout() }
WindowInsetListener // API Level 20+ view.setOnApplyWindowInsetsListener { view, windowInsets ->
val cutout: DisplayCutout? = windowInsets.displayCutout cutout?.bounds?.bounds?.let { view.translationX = it.right.toFloat() view.translationY = it.exactCenterY() - (view.measuredHeight() / 2) } windowInsets.consumeDisplayCutout() }
WindowInsetListener
Summary • Most apps don’t need to worry about DisplayCutout
• Status bar height can change • WindowInsetListener to get cutout position • LAYOUT_IN_DISPLAY_CUTOUT_MODE for fullscreen Activities • Clock & Notifications only shown on the left-hand side of status bar
Introducing DisplayCutout Shibuya.apk #24