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
Android 14 と Predictive back gesture / Shibuya...
Search
star_zero
May 26, 2023
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android 14 と Predictive back gesture / Shibuya.apk #42
star_zero
May 26, 2023
More Decks by star_zero
See All by star_zero
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1.6k
Jetpack Compose の Side-effect を使いこなす / DroidKaigi 2023
star_zero
5
7.2k
Android 14 新機能 / Android 14 Meetup Nagoya
star_zero
1
690
Coroutines Test 入門 / Android Test Night #8
star_zero
2
1.4k
What's new in Jetpack / I/O Extended Japan 2022
star_zero
1
710
Kotlin 2021 Recap / DevFest 2021
star_zero
3
1.4k
Kotlin Symbol Processing (KSP) を使ったコード生成 / DroidKaigi 2021
star_zero
2
5.3k
What's new Android 12
star_zero
0
630
これからはじめるAndroid開発 / DevFest 2020
star_zero
4
780
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
650
Evolving SEO for Evolving Search Engines
ryanjones
0
250
A Tale of Four Properties
chriscoyier
163
24k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
360
Building Applications with DynamoDB
mza
96
7.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
A better future with KSS
kneath
240
18k
エンジニアに許された特別な時間の終わり
watany
108
250k
Six Lessons from altMBA
skipperchong
29
4.4k
Scaling GitHub
holman
464
140k
Transcript
@STAR_ZERO Shibuya.apk #42 2023/05/26 Android 14 と Predictive back gesture
https://developer.android.com/guide/navigation/predictive-back-gesture
• Android 13で導入 • ホームに戻ることが予測できるようなアニメーション • Opt-inが必要 • 端末の開発者向けオプションで設定が必要 •
AndroidXライブラリの使用が推奨 ◦ KEYCODE_BACK と onBackPressed は使用しない Predictive back gesture
• アプリ全体でのOpt-inではなく、Activity単位で可能に • Activity間のアニメーション • 新しいAPIが追加され、カスタムアニメーションが可能に • 一部 Material Component
が対応 Android 14での新機能
Activity単位のOpt-in <manifest> <application <activity android:name=".MainActivity"> <!-- ... --> </activity> <!--
このActivityだけ Predicitive back gesture を有効にする --> <activity android:name=".SampleActivity" android:enableOnBackInvokedCallback="true" /> </application> </manifest>
Activity間のアニメーション https://developer.android.com/about/versions/14/features/predictive-back
新しいAPI (androidx.activity 1.8.0-alpha01 から) val callback = object : OnBackPressedCallback(true)
{ override fun handleOnBackPressed() { } override fun handleOnBackProgressed(backEvent: BackEvent) { // gestureの進捗 } override fun handleOnBackCancelled() { // キャンセルされたとき } override fun handleOnBackStarted(backEvent: BackEvent) { // gestureが始まったとき } }
Material Component対応 (Viewシステム)
• https://developer.android.com/guide/navigation/predictive-ba ck-gesture • https://developer.android.com/about/versions/14/features/pre dictive-back • https://github.com/material-components/material-componen ts-android/blob/master/docs/foundations/PredictiveBack.md Appendix
ありがとうございました