Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19ffd1d0 authored by Svet Ganov's avatar Svet Ganov
Browse files

Fill UI polish

1. Avoid jank when the suggesting list scrolled

2. Remove hard-coded values from max popup height

3. UX requested tweaks

4. Remove dead code

Test: manual

bug:37245055
bug:37179467

Change-Id: I6a6760edb06230e3d4925e23863667cfd3ac0601
parent 1f58ad1a
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<inset xmlns:android="http://schemas.android.com/apk/res/android">
    <shape android:shape="rectangle">
        <corners android:radius="2dp" />
        <solid android:color="?attr/colorBackground" />
    </shape>
</inset>
+13 −7
Original line number Diff line number Diff line
@@ -14,11 +14,17 @@
     limitations under the License.
-->

<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/autofill_dataset_picker"
    android:layout_width="wrap_content"
<FrameLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    style="@style/AutofillDatasetPicker">

    <ListView
        android:id="@+id/autofill_dataset_list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:divider="@null"
    android:background="#ffffffff"
    android:elevation="@dimen/floating_window_z">
        android:visibility="gone">
    </ListView>

</FrameLayout>
+6 −0
Original line number Diff line number Diff line
@@ -1482,4 +1482,10 @@ please see styles_device_defaults.xml.
        <item name="successColor">@color/lock_pattern_view_success_color</item>
    </style>

    <!-- @hide -->
    <style name="AutofillDatasetPicker">
        <item name="elevation">4dp</item>
        <item name="background">@drawable/autofill_dataset_picker_background</item>
    </style>

</resources>
+3 −2
Original line number Diff line number Diff line
@@ -2866,10 +2866,9 @@
  <java-symbol type="dimen" name="item_touch_helper_swipe_escape_max_velocity"/>

  <!-- com.android.server.autofill -->
  <!-- TODO: floating_window_z temporary exposed until Autofill UI uses a ContextThemeWrapper -->
  <java-symbol type="dimen" name="floating_window_z" />
  <java-symbol type="layout" name="autofill_save"/>
  <java-symbol type="layout" name="autofill_dataset_picker"/>
  <java-symbol type="id" name="autofill_dataset_list"/>
  <java-symbol type="id" name="autofill" />
  <java-symbol type="id" name="autofill_save_title" />
  <java-symbol type="id" name="autofill_save_subtitle" />
@@ -2890,6 +2889,8 @@
  <java-symbol type="string" name="autofill_save_type_credit_card" />
  <java-symbol type="string" name="autofill_save_type_username" />
  <java-symbol type="string" name="autofill_save_type_email_address" />
  <java-symbol type="drawable" name="autofill_dataset_picker_background" />
  <java-symbol type="style" name="AutofillDatasetPicker" />

  <!-- Accessibility fingerprint gestures -->
  <java-symbol type="string" name="capability_title_canCaptureFingerprintGestures" />
+0 −15
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.service.autofill.Dataset;
import android.service.autofill.FillResponse;
import android.service.autofill.SaveInfo;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Slog;
import android.view.autofill.AutofillId;
import android.view.autofill.IAutofillWindowPresenter;
@@ -50,8 +49,6 @@ import java.io.PrintWriter;
public final class AutoFillUI {
    private static final String TAG = "AutoFillUI";

    private static final int MAX_SAVE_TIMEOUT_MS = (int) (30 * DateUtils.SECOND_IN_MILLIS);

    private final Handler mHandler = UiThread.getHandler();
    private final @NonNull Context mContext;

@@ -60,7 +57,6 @@ public final class AutoFillUI {

    private @Nullable AutoFillUiCallback mCallback;

    private int mSaveTimeoutMs = (int) (5 * DateUtils.SECOND_IN_MILLIS);
    private final MetricsLogger mMetricsLogger = new MetricsLogger();

    public interface AutoFillUiCallback {
@@ -273,22 +269,11 @@ public final class AutoFillUI {
        mHandler.post(this::hideAllUiThread);
    }

    public void setSaveTimeout(int timeout) {
        if (timeout > MAX_SAVE_TIMEOUT_MS) {
            throw new IllegalArgumentException("Maximum value is " + MAX_SAVE_TIMEOUT_MS + "ms");
        }
        if (timeout <= 0) {
            throw new IllegalArgumentException("Must be a positive value");
        }
        mSaveTimeoutMs = timeout;
    }

    public void dump(PrintWriter pw) {
        pw.println("Autofill UI");
        final String prefix = "  ";
        final String prefix2 = "    ";
        pw.print(prefix); pw.print("showsSaveUi: "); pw.println(mSaveUi != null);
        pw.print(prefix); pw.print("save timeout: "); pw.println(mSaveTimeoutMs);
        if (mFillUi != null) {
            pw.print(prefix); pw.println("showsFillUi: true");
            mFillUi.dump(pw, prefix2);
Loading