Status Update
Comments
ma...@google.com <ma...@google.com> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
mo...@google.com <mo...@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?
st...@google.com <st...@google.com> #6
le...@google.com <le...@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.
le...@google.com <le...@google.com>
do...@gmail.com <do...@gmail.com> #10
Works perfectly fine on the latest stable and alpha versions. Did you check in my second comment if you enabled everything?
le...@google.com <le...@google.com>
ap...@google.com <ap...@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.
to...@undo.app <to...@undo.app> #12
le...@google.com <le...@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...
to...@undo.app <to...@undo.app> #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
le...@google.com <le...@google.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
Issue
TLDR; watch the attached video.
Was trying to make a free flowing bottom sheet like view, that allows for the sheet content to also be scrollable.
Was able to create this using Code
.draggable()
and a nested scroll connection.Drags are working fine. But flings aren't, when the sheet is still moving. Because the fling velocity being reported in
NestedScrollConnection.onPreFling()
is wrong. Sometimes even in the opposite direction, if not the wrong magnitude.Root Cause
I suspect this is because the velocity calculation is based on touch position relative to the component handling the pointer input.
Documentation of
PointerInputChange
statesModifier.draggable
which is also used inModifier.scrollable
effectively usesVelocityTracker.addPointerInputChange()
Potential Fix
If
PointerInputChange
also hadabsolutePosition
which is relative to the window/screen, and the above function is modified to useabsolutePosition
instead ofposition
(relative), then we will see the right velocity being calculated when drag has stoppedI am not sure if we will need relative velocity of the user's fling to the component anywhere. It should be safe to move the implementation
VelocityTracker.addPointerInputChange()
to useabsolutePosition
always.Other components that are affected (currently working around it)
Because of this issue, even Swipeable.kt
Swipeable.kt
doesn't use fling velocity to infer the direction of swipe, instead uses the diff of current offset and last offset -Attachments