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
Jetpack Composeで自動入力を完全攻略(作成:o3)
Search
tonionagauzzi
April 24, 2025
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jetpack Composeで自動入力を完全攻略(作成:o3)
tonionagauzzi
April 24, 2025
More Decks by tonionagauzzi
See All by tonionagauzzi
Androidエンジニアが大規模プロダクトのWebフロントエンドとバックエンドに越境して感じたギャップと習得したマインド
tonionagauzzi
0
390
Kotlin2.3明示的バッキングフィールド
tonionagauzzi
1
400
【Android】テキスト選択色の問題修正で心がけたこと
tonionagauzzi
0
280
Android 15以上でPDFのテキスト検索を爆速開発!
tonionagauzzi
0
400
Googleの新しいコーディングAIエージェントJulesを使ってみた
tonionagauzzi
0
860
Compose におけるパスワード自動入力とパスワード保存
tonionagauzzi
0
550
Androidテスト基礎講義
tonionagauzzi
0
410
Android Composeでの自動入力(作成:GPT-4o)
tonionagauzzi
0
170
Jetpack Composeで自動入力(Autofill)を実装しよう(作成:claude-3.7-sonnet)
tonionagauzzi
0
180
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Paper Plane
katiecoart
PRO
3
53k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
520
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Utilizing Notion as your number one productivity tool
mfonobong
4
590
The browser strikes back
jonoalderson
0
1.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Transcript
Jetpack Compose で 自動入力(Autofill)を完全攻略 Android Study JAM / 2025 Speaker:
トニオ・ナガウッツィ 1
Agenda 1. 自動入力(Autofill)とは 2. Compose UI 1.8 での実装方法 3. パスワード保存のハマりどころ
4. CredentialManager による解決策 5. まとめ & Q&A 2
自動入力とは? ユーザー名やパスワードを自動で入力・生成する Android OS の機能 旧 View 系では android:autofillHints で簡単設定
Jetpack Compose では UI 1.8 から正式サポート Compose UI <1.8 でも AutofillType が存在するが非推奨 & 挙動が不安定 3
Step 1 Compose UI 1.8 へのアップデート // build.gradle.kts(:app) dependencies {
implementation("androidx.compose.ui:ui:1.8.0-beta03") } 1.7 系以前は Autofill API が Experimental beta02 以前に既知のバグ → beta03 推奨 4
Step 2 保存済みパスワードを呼び出す Column { TextField( value = username.value, onValueChange
= { username.value = it }, modifier = Modifier .semantics { contentType = ContentType.Username } ) TextField( value = password.value, onValueChange = { password.value = it }, modifier = Modifier .semantics { contentType = ContentType.Password } ) } contentType を指定するだけ! 5
Step 3 新しいパスワードを自動生成 Column { TextField( value = newPassword.value, onValueChange
= { newPassword.value = it }, modifier = Modifier .semantics { contentType = ContentType.NewPassword } ) TextField( value = newPasswordToConfirm.value, onValueChange = { newPasswordToConfirm.value = it }, modifier = Modifier .semantics { contentType = ContentType.NewPassword } ) } 2 つの欄に同じ生成パスワードが同時入力される 6
Step 4 パスワードを保存したい! (AutofillManager 編) val autofillManager = LocalAutofillManager.current Button(onClick
= { autofillManager?.commit() }) { Text("Reset credentials") } しかし… ダイアログが表示されないケース多数 要件が厳しすぎる 7
AutofillManager の罠 1. ContentType.NewUsername & ContentType.NewPassword を 同じ Composable に
配置 2. ユーザーが 両方のフィールドを編集 しないと commit が無効 実際の UI/UX と合わない Issue Tracker でも多数報告 (link) 8
Step 5 CredentialManager で解決 val context = LocalContext.current val scope
= rememberCoroutineScope() Button(onClick = { scope.launch { val cm = CredentialManager.create(context) val req = CreatePasswordRequest(username, newPassword.value) cm.createCredential(request = req, context = context) } }) { Text("Reset credentials") } 依存関係: implementation("androidx.credentials:credentials:1.2.0") 9
ベストプラクティス & Tips UI 1.8 以上を必須にする Modifier.semantics { contentType =
... } を忘れない 保存機能は CredentialManager で実装 端末側の「自動入力サービス」が有効かを事前にガイド 10
まとめ Compose でも自動入力は簡単! 読込: contentType を設定するだけ 保存: AutofillManager は条件が厳しい →
CredentialManager を使う 最新情報は公式ドキュメント & Issue Tracker をチェック 11
ご清聴ありがとうございました 質問タイム 12