From 968c868b9da9308035f1d4e9c8f1e29d53da7bd6 Mon Sep 17 00:00:00 2001 From: TYM Tsai Date: Thu, 17 Feb 2022 03:20:11 +0800 Subject: Adjust fill dialog UI 1. Make rounded corners on the Fill dialog. 2. Fixed the position of the secondary button in the fill dialog and save UI. 3. Change the text of the secondary button in the fill dialog to "No thinks". 4. Reduce the size of the icon in the fill dialog. 5. Darken the outside of the fill dialog. Bug: 213136422 Test: Manual Change-Id: Ieecaa6b777ffd0600b88b29a18c1c48b1394a431 --- core/res/res/layout/autofill_fill_dialog.xml | 17 +++++------------ core/res/res/layout/autofill_save.xml | 2 +- core/res/res/values/dimens.xml | 2 +- .../com/android/server/autofill/ui/DialogFillUi.java | 7 ++++++- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/core/res/res/layout/autofill_fill_dialog.xml b/core/res/res/layout/autofill_fill_dialog.xml index cce9593f1f2a..252f59e5ac62 100644 --- a/core/res/res/layout/autofill_fill_dialog.xml +++ b/core/res/res/layout/autofill_fill_dialog.xml @@ -22,8 +22,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/autofill_save_outer_top_margin" android:padding="@dimen/autofill_save_outer_top_padding" - android:elevation="@dimen/autofill_elevation" - android:background="?android:attr/colorBackground" + android:background="@drawable/bottomsheet_background" android:orientation="vertical"> + android:visibility="gone" /> + android:text="@string/autofill_save_no"> 3 - 56dp + 24dp 56dp diff --git a/services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java b/services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java index 75d9b7eeecbc..f9f5289ec6bf 100644 --- a/services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java +++ b/services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java @@ -166,7 +166,9 @@ final class DialogFillUi { window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL - | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH); + | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH + | WindowManager.LayoutParams.FLAG_DIM_BEHIND); + window.setDimAmount(0.6f); window.addPrivateFlags(WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); window.setGravity(Gravity.BOTTOM | Gravity.CENTER); @@ -216,6 +218,8 @@ final class DialogFillUi { private void setDismissButton(View decor) { final TextView noButton = decor.findViewById(R.id.autofill_dialog_no); + // set "No thinks" by default + noButton.setText(R.string.autofill_save_no); noButton.setOnClickListener((v) -> mCallback.onCanceled()); } @@ -224,6 +228,7 @@ final class DialogFillUi { // set "Continue" by default yesButton.setText(R.string.autofill_continue_yes); yesButton.setOnClickListener(listener); + yesButton.setVisibility(View.VISIBLE); } private void initialAuthenticationLayout(View decor, FillResponse response) { -- cgit v1.2.3-59-g8ed1b