Fixed
Status Update
Comments
an...@google.com <an...@google.com>
lo...@gmail.com <lo...@gmail.com> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
nj...@google.com <nj...@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?
lo...@gmail.com <lo...@gmail.com> #6
Facing the same issue here, Google autofill service seems to work. Zero documentation on adding support for Autofill framework on jetpack compose.
lo...@gmail.com <lo...@gmail.com> #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?
lo...@gmail.com <lo...@gmail.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.
Description
Jetpack Compose version: 1.7.0-alpha05
Jetpack Compose component(s) used: ui-graphics
Hello!
I've tried the new
GraphicsLayer
API. It's nice!There's one confusing part: the
buildLayer
function that takes aGraphicsLayer
and returns the very sameGraphicsLayer
instance.I initially called
rememberGraphicsLayer()
once, and tried to build multiple layers with it, which led to weird results, and it took me a while to realize that it was because eachbuildLayer
call was actually mutating/overwriting the layer I had created withrememberGraphicsLayer()
.The naming of the function led me to believe that a new layer would be returned, which wasn't the case.
If the behavior is here to stay, I think another name is necessary, to properly communicate the fact that it's touching the layer it's called on.
To avoid this misunderstanding that easily leads to sneakily unwanted behavior (aka. bugs), I suggest a different name is used.
My vote is for
update
, without returning theGraphicsLayer
object.The name
update
is already used inside Compose, it's the name of the parameter of theAndroidView
composable function that updates stuff inside theView
, which, just likeGraphicsLayer
, will keep state mutations.I hope it helps!
Have a great day,
Louis CAD