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
680
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Display Cutout
Panini
April 13, 2018
More Decks by Panini
See All by Panini
Kotlin 1.5 preview
panini
1
480
Java谷園から逃げ出した話
panini
0
410
Kotlin 1.4-rc
panini
0
250
Fixing Broken Robots - Android Mutation Testing
panini
0
220
Kotlin Multiplatform
panini
2
700
build.gradle.kts
panini
2
2.5k
Kotlin Multi-platform(?)
panini
1
780
Convert Java file to Kotlin file ⌥⇧⌘K
panini
0
1.2k
Introducing Android P
panini
2
870
Other Decks in Programming
See All in Programming
Inside Stream API
skrb
1
730
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
200
Performance Engineering for Everyone
elenatanasoiu
0
170
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
790
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
100
Claspは野良GASの夢をみるか
takter00
0
200
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.3k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
540
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
560
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
200
AI時代のUIはどこへ行く?その2!
yusukebe
21
7.3k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
エンジニアに許された特別な時間の終わり
watany
107
250k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
720
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Designing for humans not robots
tammielis
254
26k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
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