Fixed
Status Update
Comments
da...@well.co <da...@well.co> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
da...@well.co <da...@well.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?
je...@google.com <je...@google.com>
mn...@google.com <mn...@google.com> #6
Facing the same issue here, Google autofill service seems to work. Zero documentation on adding support for Autofill framework on jetpack compose.
da...@well.co <da...@well.co> #7
Hello, I am trying to implement the same thing - it seems like there's no way for current password managers like 1Password or Bitwarden, to automatically pick up the fields. Is there a possible solution?
da...@well.co <da...@well.co> #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.
se...@google.com <se...@google.com> #10
Works perfectly fine on the latest stable and alpha versions. Did you check in my second comment if you enabled everything?
na...@google.com <na...@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.
Description
2023.10.00-alpha01 // broken
2023.09.00-alpha03 // working
Jetpack Compose component(s) used:
LiveRegion
Android Studio Build:
Android Studio Koala | 2024.1.1 Canary 8
Kotlin version:
1.9.0
Steps to Reproduce or Code Sample to Reproduce:
1. Run this project
2. Click on Button
Expected: I would expect it to announce "David" when pressing the button which is a LiveRegion that becomes visible.
Actual: It does not announce the live region.
If you run the exact code but then change the toml file to the
"2023.09.00-alpha03" as mentioned here
It works
Summary:
So either compose changed something and I need to change my live region or its just broke.
I am going to keep digging into this and see if I can give more detail but it appears these dependencies have updated
So compose 1.6.0-alpha04 vs 1.6.0-alpha05 there is the change.
This is a pretty bad bug as any errors are not announced in most apps as they happen or whatever else use case a person has for live region