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
690
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
490
Java谷園から逃げ出した話
panini
0
410
Kotlin 1.4-rc
panini
0
250
Fixing Broken Robots - Android Mutation Testing
panini
0
220
Kotlin Multiplatform
panini
2
710
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
880
Other Decks in Programming
See All in Programming
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
1
810
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.3k
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
28
17k
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
240
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.9k
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
440
Cloudflare is Agents
chimame
0
180
信頼性の目標を誰も求めてない
shubox
0
160
Introducing Stack Pull Request in GitHub
kkamegawa
0
110
リアルな遅延を測る仕様
kota_yata
1
130
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
530
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Automating Front-end Workflow
addyosmani
1369
210k
HDC tutorial
michielstock
2
820
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
500
My Coaching Mixtape
mlcsv
0
300
Designing Experiences People Love
moore
143
24k
Deep Space Network (abreviated)
tonyrice
0
270
Building an army of robots
kneath
306
46k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
480
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