Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Display Cutout
Search
Panini
April 13, 2018
Programming
710
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
500
Java谷園から逃げ出した話
panini
0
420
Kotlin 1.4-rc
panini
0
260
Fixing Broken Robots - Android Mutation Testing
panini
0
230
Kotlin Multiplatform
panini
2
730
build.gradle.kts
panini
2
2.5k
Kotlin Multi-platform(?)
panini
1
800
Convert Java file to Kotlin file ⌥⇧⌘K
panini
0
1.2k
Introducing Android P
panini
2
890
Other Decks in Programming
See All in Programming
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
380
JIS keyboard support in Omarchy
lef237
0
180
LLM 101
dalinaum
0
440
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
6.1k
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
140
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
180
Crash Auto Pipelines
veronikapj
1
300
No More NoSuchMethodError
exoego
1
120
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
sbt 2.0: takeoff
eed3si9n
0
180
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
7.1k
Performance Optimization With LLMs
xleitix
0
230
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
The Limits of Empathy - UXLibs8
cassininazir
2
750
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
WENDY [Excerpt]
tessaabrams
14
40k
Raft: Consensus for Rubyists
vanstee
143
7.8k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
580
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
The Pragmatic Product Professional
lauravandoore
37
7.5k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
4 Signs Your Business is Dying
shpigford
187
23k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
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