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
670
Display Cutout
Panini
April 13, 2018
Tweet
Share
More Decks by Panini
See All by Panini
Kotlin 1.5 preview
panini
1
470
Java谷園から逃げ出した話
panini
0
400
Kotlin 1.4-rc
panini
0
250
Fixing Broken Robots - Android Mutation Testing
panini
0
210
Kotlin Multiplatform
panini
2
680
build.gradle.kts
panini
2
2.4k
Kotlin Multi-platform(?)
panini
1
750
Convert Java file to Kotlin file ⌥⇧⌘K
panini
0
1.1k
Introducing Android P
panini
2
850
Other Decks in Programming
See All in Programming
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
130
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
130
並行開発のためのコードレビュー
miyukiw
2
2.1k
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
220
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
420
浮動小数の比較について
kishikawakatsumi
0
360
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.3k
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
180
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
120
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
2
220
AHC061解説
shun_pi
0
280
Featured
See All Featured
Balancing Empowerment & Direction
lara
5
930
The Curious Case for Waylosing
cassininazir
0
260
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
78
Writing Fast Ruby
sferik
630
62k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
130
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
280
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
180
The untapped power of vector embeddings
frankvandijk
2
1.6k
30 Presentation Tips
portentint
PRO
1
250
Deep Space Network (abreviated)
tonyrice
0
84
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