Status Update
Comments
so...@google.com <so...@google.com>
zs...@salesforce.com <zs...@salesforce.com> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
kl...@google.com <kl...@google.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?
so...@google.com <so...@google.com> #4
cl...@google.com <cl...@google.com> #6
so...@google.com <so...@google.com> #7
kl...@google.com <kl...@google.com>
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.
br...@monzo.com <br...@monzo.com> #10
Works perfectly fine on the latest stable and alpha versions. Did you check in my second comment if you enabled everything?
zl...@google.com <zl...@google.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.
[Deleted User] <[Deleted User]> #12
sr...@gmail.com <sr...@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
I'm currently exploring rendering markdown-style links using ClickableText/AnnotatedStrings, similar to how JetChat works here:https://github.com/android/compose-samples/blob/ee198110d8a7575da281de9bd0f84e91970468ca/Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/Conversation.kt#L481
I'm running into issues with matching the accessibility experience of the old View system. In the old system, URLSpans automatically provided a great accessibility UX:
This doesn't seem to be possible to replicate in Compose. All I can find in the semantics API is "custom actions", which is a similar but worse experience (no ding sound, no specific "links" submenu, no hint to the user that there's links to be clicked, etc).
I think this inconsistency will be confusing for accessibility users. Can we get a new API to help replicate the functionality of the View system? For example, could we add an annotation to indicate to TalkBack where the links are?
Thanks!