Reputation: 1393
I had refactored a login flow from XML to Compose.
The old login flow, after logging in successfully, would have Google suggest to save your password.
However, since I refactored it, it doesn't do this anymore.
The old XML layout just used a TextInputLayout
and TextInputEditText
. The new composable is just an OutlinedTextField
with some keyboard options.
<com.google.android.material.textfield.TextInputLayout
style="@style/TextInputLayoutStyle"
android:theme="@style/TextInputLayoutStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
android:hint="@string/password">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
OutlinedTextField(
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Password,
imeAction = ImeAction.Done
)
)
Why is Google not suggesting to save the password? Both old and new code was run on the same emulator, which has auto fill services enabled.
Upvotes: 7
Views: 2144
Reputation: 1006944
There is limited autofill support in Compose UI 1.0.x. With luck, this situation will improve in the coming years.
Upvotes: 3