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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
880
Other Decks in Programming
See All in Programming
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
9.1k
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.7k
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
930
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
850
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.5k
act2-costs.pdf
sumedhbala
0
110
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
110
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
490
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
230
5分で問診!Composer セキュリティ健康診断
codmoninc
0
250
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
2
1.5k
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Raft: Consensus for Rubyists
vanstee
141
7.6k
The Curious Case for Waylosing
cassininazir
1
430
ラッコキーワード サービス紹介資料
rakko
1
3.9M
Music & Morning Musume
bryan
47
7.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
My Coaching Mixtape
mlcsv
0
170
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Marketing to machines
jonoalderson
1
5.6k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
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