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 新機能 / Android 14 Meetup Nagoya
Search
star_zero
August 10, 2023
Programming
1
620
Android 14 新機能 / Android 14 Meetup Nagoya
star_zero
August 10, 2023
Tweet
Share
More Decks by star_zero
See All by star_zero
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1.4k
Jetpack Compose の Side-effect を使いこなす / DroidKaigi 2023
star_zero
5
6.4k
Android 14 と Predictive back gesture / Shibuya.apk #42
star_zero
0
410
Coroutines Test 入門 / Android Test Night #8
star_zero
2
1.2k
What's new in Jetpack / I/O Extended Japan 2022
star_zero
1
660
Kotlin 2021 Recap / DevFest 2021
star_zero
3
1.3k
Kotlin Symbol Processing (KSP) を使ったコード生成 / DroidKaigi 2021
star_zero
2
5.2k
What's new Android 12
star_zero
0
580
これからはじめるAndroid開発 / DevFest 2020
star_zero
4
720
Other Decks in Programming
See All in Programming
ソフトウェア設計の実践的な考え方
masuda220
PRO
3
470
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3k
Web技術を最大限活用してRAW画像を現像する / Developing RAW Images on the Web
ssssota
2
1.2k
NetworkXとGNNで学ぶグラフデータ分析入門〜複雑な関係性を解き明かすPythonの力〜
mhrtech
3
990
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
380
非同期jobをtransaction内で 呼ぶなよ!絶対に呼ぶなよ!
alstrocrack
0
520
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
190
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
140
Reduxモダナイズ 〜コードのモダン化を通して、将来のライブラリ移行に備える〜
pvcresin
2
680
ネイティブ製ガントチャートUIを作って学ぶUICollectionViewLayoutの威力
jrsaruo
0
130
猫と暮らすネットワークカメラ生活🐈 ~Vision frameworkでペットを愛でよう~ / iOSDC Japan 2025
yutailang0119
0
220
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
570
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
4 Signs Your Business is Dying
shpigford
185
22k
Optimizing for Happiness
mojombo
379
70k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
20k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
How to Ace a Technical Interview
jacobian
280
23k
Transcript
Android 14 Meetup Nagoya 2023/08/10 Android 14 新機能
• Kenji Abe • Google Developers Expert for Android, Kotlin
• DeNA Co., Ltd. • X: @STAR_ZERO • Bluesky: @star-zero.com 自己紹介
Per-app language preferences
• AGP 8.1.0-alpha07 から • values-* フォルダを判別して LocaleConfig を自動で生成 LocaleConfigの自動生成
// app/build.gradle android { androidResources { generateLocaleConfig = true }
} // res/resources.properties unqualifiedResLocale=en-US
None
• 実行中にアプリごとの言語設定を変更可能 • A/Bテストや、地域によって設定を変えたりなど可能に LocaleConfigの動的更新
val localManger = getSystemService<LocaleManager>()!! // 言語設定をOverride localManger.overrideLocaleConfig = LocaleConfig( LocaleList(
Locale.ENGLISH, Locale.ITALIAN ) ) // Overrideした設定を戻す localManger.overrideLocaleConfig = null
Grammatical Inflection API
• フランス語 ◦ 男性: Vous êtes abonné à… ◦ 女性:
Vous êtes abonnée à… ◦ 中立: Abonnement à...activé Grammatical Inflection API
None
val grammaticalInflectionManager = context.getSystemService<GrammaticalInflectionManager>()!! grammaticalInflectionManager .setRequestedApplicationGrammaticalGender( Configuration.GRAMMATICAL_GENDER_FEMININE // or Configuration.GRAMMATICAL_GENDER_MASCULINE
// or Configuration.GRAMMATICAL_GENDER_NEUTRAL // or Configuration.GRAMMATICAL_GENDER_NOT_SPECIFIED )
地域別の設定
None
地域別の設定 // androidx.core:core:1.12.0 val temperature = LocalePreferences.getTemperatureUnit() val firstDayOfWeek =
LocalePreferences.getFirstDayOfWeek()
Screenshot detection API
• スクリーンショットを撮ったことを検知できる • スクリーンショット自体を取得することはできない Screenshot detection API
<!-- AndroidManifest.xml --> <uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE" />
class MainActivity : ComponentActivity() { val screenCaptureCallback = ScreenCaptureCallback {
// ... } override fun onStart() { super.onStart() registerScreenCaptureCallback( mainExecutor, screenCaptureCallback ) } override fun onStop() { super.onStop() unregisterScreenCaptureCallback(screenCaptureCallback) } }
None
Predictive Back Gesture
• Android 13で導入、Android 14で改善 • Activity単位でのOpt-in • Activity間でのアニメーション • 新しいAPIが追加され、カスタムアニメーションが可能に
Predictive Back Gesture
<manifest> <application> <activity android:name=".MainActivity"> <!-- ... --> </activity> <!-- このActivityだけ
Predicitive back gesture を有効にする --> <activity android:name=".SampleActivity" android:enableOnBackInvokedCallback="true" /> </application> </manifest>
https://developer.android.com/about/versions/14/features/predictive-back
// androidx.activity:activity-ktx:1.8.0-alpha06 val callBack = object : OnBackPressedCallback(true) { override
fun handleOnBackStarted(backEvent: BackEventCompat) { // Gestureが始まったとき } override fun handleOnBackProgressed(backEvent: BackEventCompat) { // Gestureの進捗 } override fun handleOnBackPressed() { // Gestureが完了したとき } override fun handleOnBackCancelled() { // キャンセルされたとき } }
Path
val path = Path().apply { moveTo(0f, 0f) lineTo(200f, 0f) lineTo(200f,
200f) lineTo(0f, 200f) close() } canvas.drawPath(path, paint)
val pathIterator = path.pathIterator pathIterator.forEach { segment -> // PathIterator.VERB_MOVE,
// PathIterator.VERB_LINE, // PathIterator.VERB_CLOSE など val verb = segment.verb // verbの操作のポイントデータ val points = segment.points }
VERB_MOVE - [0, 0, 0, 0, 0, 0, 0, 0]
VERB_LINE - [0, 0, 200, 0, 0, 0, 0, 0] VERB_LINE - [200, 0, 200, 200, 0, 0, 0, 0] VERB_LINE - [200, 200, 0, 200, 0, 0, 0, 0] VERB_CLOSE - [200, 200, 0, 200, 0, 0, 0, 0] moveTo(0f, 0f) lineTo(200f, 0f) lineTo(200f, 200f) lineTo(0f, 200f) close()
• androidx.graphics:graphics-path もある ◦ API 21からサポート Path
ありがとうございました