【问题标题】:Android autofill suggest new password similar to Google ChromeAndroid自动填充提示新密码类似于谷歌浏览器
【发布时间】:2020-11-24 05:18:19
【问题描述】:

我有一个简单的创建帐户屏幕,如图所示:

<?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>

当我选择电子邮件字段时,谷歌自动填充服务会建议填写一个电子邮件地址。有没有办法触发密码管理器建议一个新的安全密码?我在谷歌浏览器中看到了这种行为,这个功能在原生安卓应用中可用吗?

【问题讨论】:

    标签: android passwords autofill


    【解决方案1】:

    我自己花了很多时间寻找这个,显然这是 chrome 上的自定义功能(来源:android police

    Google 的androidx.autofill 团队触手可及

    【讨论】:

      猜你喜欢
      • 2014-06-03
      • 2019-12-24
      • 1970-01-01
      • 2018-07-18
      • 2011-11-05
      • 2011-06-10
      • 2014-02-19
      相关资源
      最近更新 更多