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
Autofill Framework
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
uzzu
December 17, 2020
Technology
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Autofill Framework
第2回Android知見共有会 @cookpad
uzzu
December 17, 2020
More Decks by uzzu
See All by uzzu
Context Receiversに思いを馳せる / Context Receivers
uzzu
0
760
StoreKitのこれまでとこれから / StoreKit 2 from 1
uzzu
5
21k
アプリ内課金の最新事情 クライアントサイド編 / In-app Purchase in Cookpad 2019
uzzu
3
4.7k
Billing Client 2.0 acknowledgement
uzzu
0
17k
Promoting IAP対応から学ぶ外部アプリ内課金実装 / Promoting IAP and others
uzzu
2
1.6k
ブログ作り直した / My blog @ Othlo Tech
uzzu
0
210
新規アプリ開発を支えるユーザ・決済基盤
uzzu
2
2.9k
kotlin-mpp-library-tips
uzzu
1
6.5k
Coroutine Kyuin
uzzu
2
340
Other Decks in Technology
See All in Technology
作って終わりにしない タイミーのセマンティックレイヤー育成の現在地
chanyou0311
4
2.3k
Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU / amazon-bedrock-agentcore-workshop-jawsug-tohoku-2026
gawa
9
760
LLMと共に進化するプロセスを目指して
ymatsuwitter
13
4.1k
Bedrock AgentCore RuntimeでAuth0 Changelog調査AIをアップグレードした話
t5u8a5a
1
110
RAG を使わないという選択肢
tatsutaka
1
210
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
510
プロダクト開発から業務改善コンサルまで。事業全体へ「染み出す」ことで広がるエンジニアの可能性
ham0215
0
120
Agent Skills設計で柔軟性と硬さのバランスが難しい話
nassy20
0
130
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
0
2.2k
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
3
200
自宅LLMの話
jacopen
1
480
チームで進めるAI駆動アジャイル×ウォーターフォール
kumaiu
0
160
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
250
First, design no harm
axbom
PRO
2
1.2k
Deep Space Network (abreviated)
tonyrice
0
170
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
610
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
610
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Bash Introduction
62gerente
615
220k
It's Worth the Effort
3n
188
29k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Building AI with AI
inesmontani
PRO
1
1.1k
Transcript
Autofill framework uzzu @ user-payment dept
Agenda ɾAutofill frameworkͬͯԿ ɾಋೖํ๏ ɾͲΜͳײ͡Ͱಈ͔͢ͷ ɾ·ͱΊ
Autofill framework ɾΞϓϦͰҎԼͷೖྗใΛࣗಈೖྗ͢Δࣄ͕Ͱ͖ΔΈ ɹΞΧϯτೝূใɺΫϨδοτΧʔυใɺॅॴɺਓ໊ɺి൪߸ɺ ɹϫϯλΠϜύεϫʔυ ɾAutofill ServiceʹରԠͨ͠ύεϫʔυϚωʔδϟʔͱ࿈ܞͯ͠ೖྗใΛอଘ͢Δࣄ ɹͰ͖Δ (ࠓճলུ) ɹ৽͍͠ύεϫʔυΛύεϫʔυϚωʔδϟͰੜ্ͨ͠Ͱࣗಈೖྗ͢ΔͳͲ
ɾWeb͚ʹDigital Asset LinksΛ༻ҙ͢Δ͜ͱͰWebͷಉαʔϏεͷೝূใΛ ɹΞϓϦͰར༻Ͱ͖Δ ɾminSdkVersion >= 26 (※)
None
͍ํ(1) - ઃఆ • ઃఆ>γεςϜ>ݴޠͱೖྗ>ৄࡉઃఆ>ೖྗΞγελϯ τ>ࣗಈೖྗαʔϏε ͔ΒࣗಈೖྗαʔϏεΛ༗ޮʹ͢ Δ ↑ΤϛϡϨʔλͰಈ࡞֬ೝ͢Δ߹ཁ֬ೝ •
্ͰGoogleΞΧϯτͰϩάΠϯ͓ͯ͘͠ͷΕ ͳ͍
͍ํ(2) - Autofill༗ޮແޮͷ֬ೝ fun Context.isAutofillAvailable(): Boolean { if (Build.VERSION.SDK_INT <
Build.VERSION_CODES.O) { return false } val manager = getSystemService(AutofillManager::class.java) return manager != null && manager.isEnabled }
͍ํ(3) - ࣗಈೖྗͷͨΊͷHintͷઃఆ • ࢦఆจࣈྻ View.AUTOFILL_HINT_* ͳఆ͕ٛ͋ΔͷͰͦͪΒΛࢀߟʹ • ෳ༩͑ΔࣄͰ͖Δ •
ࣗલͷViewʹHintsΛઃఆ͢Δ߹ View#setAutofillHints(vararg String) • ٯʹɺೖྗิͨ͘͠ͳ͍߹ android:importantForAutofill=“no” “auto”, “no”, “yes”, “noExcludedDescendants”, “yesExcludeDescendants” <EditText android:id="@+id/password_field" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword" android:autofillHints="password" />
͍ํ(4) - ࣗಈೖྗͨ͠༰ͷऔಘ • EditText#getText() ͳͲɺݩͷViewͷ࣮ʹ߹ΘͤͯऔಘɺͰجຊతʹOK • View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE ͷ߹ɺೖྗ༰ͷᐆດ ͞ʹҙ
(06/2022, 6/2022, June 2022, …) ->EditTextͳΓΛܧঝͯ͠AutofillValueΛ༻͍ΔࣄͰᐆດ͞Λճආ͢Δ
override fun getAutofillType(): Int { return AUTOFILL_TYPE_DATE } override fun
getAutofillValue(): AutofillValue { val calendar = Calendar.getInstance() calendar.clear() val (year, month) = sanitize(text?.toString()) calendar.set(Calendar.YEAR, year) calendar.set(Calendar.MONTH, month) val unixTime: Long = calendar.timeInMillis return AutofillValue.forDate(unixTime) } override fun autofill(value: AutofillValue) { if (!value.isDate) { return } val calendar = Calendar.getInstance() calendar.timeInMillis = value.dateValue setText(DateFormat.format("MM/yy", calendar)) }
͍ํ(5) - ͋ͱAdvanced ɾࣗಈೖྗΛ࣮ࢪ͠ͳ͍߹AutofillManager#cancel ɾActivity1ͭʹର͠ෳͷFragmentͰը໘ભҠ͠ͳ͕Βೖ ྗ͢Δ߹ɺ࠷ޙʹ AutoFillManager#commit ͢Δ
طͷ(1) - DialogͰͷར༻ • API Level 27ҎલͰDialogͷϏϡʔΛදࣔޙʹαΠ ζมߋΛ͢ΔͱࣗಈೖྗͷରͱΈͳ͞Εͳ͘ͳΔ
طͷ(1) - ճආࡦ • window token ΛৼΓ͢ class Dialog(context: Context)
: Dialog(context) { private var token: IBinder? = null override fun onWindowAttributesChanged(params: WindowManager.LayoutParams) { if (params.token == null && token != null) { params.token = token } super.onWindowAttributesChanged(params) } override fun onAttachedToWindow() { if (context.isDialogResizedWorkAroundRequired() /* API 26ͩͬͨΒ */) { token = requireNotNull(ownerActivity).window.attributes.token } super.onAttachedToWindow() } }
طͷ(2) - RecyclerViewͰͷར༻ • RecyclerViewͰͷར༻࣌ʹҙਤͤ͵ೖྗϑΟʔϧυʹ ࣗಈೖྗ͞Εͯ͠·͏ (View͕࠶ར༻͞ΕΔࣄ͕͋Δͷ͔ͩΒͳΜͱͳ͘ ؾ͔࣋ͪΔ…)
طͷ(2) - ղܾࡦ (minSdkVersion >= 28) • AutofillManager͕IdΛ࠾൪͍ͯ͠ΔͷͰɺ֤ΞΠςϜʹIdΛ࠾൪͢Δ data class
Item( val text: String, // Viewදࣔͷҝͷͳʹ͔ // : val autofillId: Int // Autofill framework༻ͷId ΛՃ ) // RecyclerViewʹՃ͢Δཁૉʹ1ͭͣͭ࠾൪ val autofillId = autofillManager.nextAutofillId • ͦͷޙonBindViewHolderͰViewHolder্Ͱ͍࣋ͬͯΔTextViewʹ View#setAutofillId(autofillId) ͢Δ
·ͱΊ • ϑΟʔϧυʹೖྗ͢Δ࣌ؒΛݮͨ͠ΓɺೖྗϛεΛ࠷খݶʹ͑Δࣄ͕Ͱ͖Δ • Autofill ServiceʹରԠͨ͠ύεϫʔυϚωʔδϟʔͱ࿈ܞͯ͠ೖྗใΛอଘͰ͖Δ • ΣϒαΠτͱͷؔ࿈͚Ͱ AndroidΞϓϦͰͷϩάΠϯ࣌ʹ WebͰͷϩάΠϯใΛࣗಈೖྗͰ͖Δ
• minSdkVersion >=26 Ͱ͋Δ͕ɺطͷʹखؒগͳ͘ରॲ͢ΔͳΒ minSdkVersion >= 28 • androidx.autofill Ͱ͏গ͠Ճػೳ͕͑Δ (ιϑτΣΞΩʔϘʔυɺOTPपΓͷαϙʔτ͕खް͍)͕ ݱࡏ1.1.0-rc01 minSdkVersion >= 30