Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Display Cutout
Search
Panini
April 13, 2018
Programming
1
660
Display Cutout
Panini
April 13, 2018
Tweet
Share
More Decks by Panini
See All by Panini
Kotlin 1.5 preview
panini
1
460
Java谷園から逃げ出した話
panini
0
390
Kotlin 1.4-rc
panini
0
240
Fixing Broken Robots - Android Mutation Testing
panini
0
200
Kotlin Multiplatform
panini
2
670
build.gradle.kts
panini
2
2.4k
Kotlin Multi-platform(?)
panini
1
740
Convert Java file to Kotlin file ⌥⇧⌘K
panini
0
1.1k
Introducing Android P
panini
2
840
Other Decks in Programming
See All in Programming
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
350
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
410
Deno Tunnel を使ってみた話
kamekyame
0
140
愛される翻訳の秘訣
kishikawakatsumi
3
330
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
440
Python札幌 LT資料
t3tra
3
540
AIコーディングエージェント(Gemini)
kondai24
0
240
Developing static sites with Ruby
okuramasafumi
0
310
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
JETLS.jl ─ A New Language Server for Julia
abap34
1
420
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
2
220
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Context Engineering - Making Every Token Count
addyosmani
9
530
Code Reviewing Like a Champion
maltzj
527
40k
GraphQLとの向き合い方2022年版
quramy
50
14k
Navigating Team Friction
lara
191
16k
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Typedesign – Prime Four
hannesfritz
42
2.9k
For a Future-Friendly Web
brad_frost
180
10k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
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