Status Update
Comments
pa...@hinge.co <pa...@hinge.co> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
pa...@hinge.co <pa...@hinge.co> #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?
kl...@google.com <kl...@google.com>
si...@google.com <si...@google.com>
kl...@google.com <kl...@google.com> #5
kl...@google.com <kl...@google.com> #6
kl...@google.com <kl...@google.com> #7
ap...@google.com <ap...@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.
ju...@google.com <ju...@google.com> #10
Works perfectly fine on the latest stable and alpha versions. Did you check in my second comment if you enabled everything?
sv...@gmail.com <sv...@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.
fu...@gmail.com <fu...@gmail.com> #12
fu...@gmail.com <fu...@gmail.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...
Description
- Jetpack Compose component used: ClickableText with AnnotatedString including UrlAnnotation
- Android Studio Build: Android Studio Chipmunk | 2021.2.1 Patch 2
Build #AI-212.5712.43.2112.8815526, built on July 10, 2022
- Kotlin version: 1.7.20
- Devices/Android versions reproduced on: Android 30, 33 on Pixel 4As
- Keyboard (i.e. Gboard, Samsung, etc): Stock Google keyboard
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue:
- A screenrecord or screenshots showing the issue (if UI related). This is included with the sample project but I attached it again here.
- Stack trace (if applicable) - N/A
There is a bug where the recently introduced UrlAnnotation is read correctly by Talkback, but the onClick is not called, so the link is not opened.
Steps to Reproduce:
1. Turn on Talkback in Accessibility settings
2. Run app
3. App will display a single line of text
4. Part of this text will be a URLAnnotation containing a link
5. Open the Talkback action menu per the prompt
6. Select "Links" in Talkback menu
7. Select the link to trigger the onClick method call, which opens the browser.
Expected:
1.Talkback correctly recognizes the link in the text
2. Talkback shows the link in the Talkback menu
3. When the link is selected in the Talkback menu, the onClick is called in ClickableText and the user is navigated to the browser.
Actual:
1. The onClick for the ClickableText is never called. Note that it is not the browser navigation that is broken. This can be confirmed using the logs in the sample app provided.