Status Update
Comments
ti...@google.com <ti...@google.com>
se...@candybytes.com <se...@candybytes.com> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
ku...@gmail.com <ku...@gmail.com> #3
I found an example
D/Autofill Status: Autofill popup isn't shown because autofill is not available.
Did you set up autofill?
1. Go to Settings > System > Languages&input > Advanced > Autofill Service
2. Pick a service
Did you add an account?
1. Go to Settings > System > Languages&input > Advanced
2. Click on the settings icon next to the Autofill Service
3. Add your account
Is this a bug on your side or do the app developers of these password managers need to change their implementation?
jo...@gmail.com <jo...@gmail.com> #5
de...@greyarea.no <de...@greyarea.no> #6
ja...@ntucenterprise.sg <ja...@ntucenterprise.sg> #7
si...@google.com <si...@google.com> #8
I setup this modifier:
@OptIn(ExperimentalComposeUiApi::class)
fun Modifier.autofill(
autofillTypes: List<AutofillType>,
onFill: ((String) -> Unit),
) = composed {
val autofill = LocalAutofill.current
val autofillNode = AutofillNode(onFill = onFill, autofillTypes = autofillTypes)
LocalAutofillTree.current += autofillNode
this.onGloballyPositioned {
autofillNode.boundingBox = it.boundsInWindow()
}.onFocusChanged { focusState ->
autofill?.run {
if (focusState.isFocused) {
requestAutofillForNode(autofillNode)
} else {
cancelAutofillForNode(autofillNode)
}
}
}
}
And use it like this:
val emailState = remember { EmailState() }
Email(
modifier = Modifier.autofill(
autofillTypes = listOf(
AutofillType.Username,
AutofillType.EmailAddress
),
onFill = { emailState.text = it },
),
emailState = emailState,
onImeAction = { onForgotPasswordSubmitted(emailState.text) }
)
With these steps, autofill works for me.
ha...@google.com <ha...@google.com> #10
Works perfectly fine on the latest stable and alpha versions. Did you check in my second comment if you enabled everything?
jm...@gmail.com <jm...@gmail.com> #11
I believe so?
I copied the modifier and then used
modifier = Modifier.autofill(
autofillTypes = listOf(
AutofillType.Username,
AutofillType.EmailAddress
),
onFill = { emailState.text = it },
)
on my text field.
si...@empiriecom.com <si...@empiriecom.com> #12
ap...@google.com <ap...@google.com> #13
The auto-filling works for me with the latest alpha version, but I'm never presented with the save dialog though.
I am having exactly same problem. Autofill works, but the Save dialog is never shown...
ha...@google.com <ha...@google.com> #14
Any updates on this? I can't get LastPass to display at all. I can ONLY get the Google Auto-fill service to work
wi...@dcsg.com <wi...@dcsg.com> #15
Same here, autofill in Jetpack Compose only works with the Google auto-fill service. When picking 1Password as the Auto-fill service in Settings, the debug log prints out:
D/Autofill Status: Autofill popup isn't shown because autofill is not available.
Did you set up autofill?
1. Go to Settings > System > Languages&input > Advanced > Autofill Service
2. Pick a service
Did you add an account?
1. Go to Settings > System > Languages&input > Advanced
2. Click on the settings icon next to the Autofill Service
3. Add your account
Description
Version used: androidx.activity:activity-compose:1.5.0
Theme used: -
Devices/Android versions reproduced on: Nokia 1 Android 8.1 (SDK 27) 240DPI + 480 x 854
Description: This crash log came from pre-launch report. The crash occurred only with that small device noted above. The "reviews" section is the last widget in that LazyColumn shown in screenrecord. There are no any editable textfields in that page where the app crashes.
Screenrecord of the crash:
Stacktrace:
FATAL EXCEPTION: main
Process:
java.lang.IndexOutOfBoundsException: measureLimit (120) is out of start (0) and limit (119) bounds
at android.text.TextLine.handleRun(TextLine.java:990)
at android.text.TextLine.measureRun(TextLine.java:417)
at android.text.TextLine.measure(TextLine.java:307)
at android.text.Layout.getHorizontal(Layout.java:1094)
at android.text.Layout.getHorizontal(Layout.java:1072)
at android.text.Layout.getPrimaryHorizontal(Layout.java:1043)
at android.text.Layout.getPrimaryHorizontal(Layout.java:1033)
at u1.b.a(Unknown Source:4)
at u1.b.b(Unknown Source:6)
at u1.n.g(SourceFile:2)
at b2.a.c(Unknown Source:10)
at t1.u.b(SourceFile:7)
at androidx.compose.ui.platform.r$d.addExtraDataToAccessibilityNodeInfo(SourceFile:14)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:980)
at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:336)
at android.view.AccessibilityInteractionController.-wrap1(Unknown Source:0)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1324)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)