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
490
Java谷園から逃げ出した話
panini
0
410
Kotlin 1.4-rc
panini
0
250
Fixing Broken Robots - Android Mutation Testing
panini
0
230
Kotlin Multiplatform
panini
2
720
build.gradle.kts
panini
2
2.5k
Kotlin Multi-platform(?)
panini
1
790
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
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
370
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
160
Simple Storage Service(S3) is not simple
iwatsukayura
0
250
phperだってパンチカードでコーディングしたい
o0h
PRO
0
270
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
setup-vp GitLab対応の裏側
naokihaba
0
160
すこし踏み込む CancellationToken
htkym
2
1.7k
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
3k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
140
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
380
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
480
contenteditable と日本語入力に向き合う
colorful12
0
190
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
300
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
BBQ
matthewcrist
90
10k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Evolving SEO for Evolving Search Engines
ryanjones
0
320
How to train your dragon (web standard)
notwaldorf
96
6.9k
Between Models and Reality
mayunak
4
490
Building an army of robots
kneath
307
47k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
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