Fixed
Status Update
Comments
an...@google.com <an...@google.com>
an...@google.com <an...@google.com> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
al...@gmail.com <al...@gmail.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?
al...@gmail.com <al...@gmail.com> #5
deleted
ap...@google.com <ap...@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.
ap...@google.com <ap...@google.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?
an...@google.com <an...@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.
Description
Android Studio 4.2 Canary 9
Build #AI-202.6397.94.42.6795674, built on August 28, 2020
Runtime version: 11.0.7+10-b765.53 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.6
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Version of Gradle Plugin:
'com.android.tools.build:gradle:4.2.0-alpha09'
compose_version = '1.0.0-alpha02'
kotlin_version = "1.4.0"
Version of Gradle:
distributionUrl=https\://
Steps to Reproduce:
number of items in list: 200
code:
LazyColumnFor(items = entries) {
Text(
text = it.word,
modifier = Modifier.clickable(indication = null, onClick = {
selectWordAction(it.word)
})
)
}
the code above was embedded as content to Scaffold.