DrZaphod
DrZaphod

Reputation: 511

Android autofill suggest new password similar to Google Chrome

I have a simple create account screen as shown:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:importantForAutofill="yes"
    android:orientation="vertical">

    <com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:autofillHints="username"
        android:hint="email"
        android:inputType="textEmailAddress">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:autofillHints="password"
        android:hint="Create a password"
        android:inputType="textPassword">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:autofillHints="password"
        android:hint="Re-enter password"
        android:inputType="textPassword">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.google.android.material.textfield.TextInputLayout>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Login" />

</LinearLayout>

When I select the email field the google autofill service suggests a email address to fill. Is there a way to trigger the password manager to suggest a new, secure password? I have seen this behaviour in Google Chrome, is this feature available in native android apps?

Upvotes: 1

Views: 748

Answers (1)

waterPoweredMonkey
waterPoweredMonkey

Reputation: 124

Spent a good bit of time looking for this one myself, apparently that's a custom feature on chrome(source: android police)

Fingers crossed Google's androidx.autofill team

Upvotes: 1

Related Questions