Commit 9126cd60 authored by Fabio Tirelo's avatar Fabio Tirelo Committed by Commit Bot

[AF Android] Addressing UX polish concerns

This CL corrects the following outstanding UX polish concerns:
* Tap effects are needed on footer rows
* Footer icon should be 14dp (vs. 16dp elsewhere), and icons should
  have explicit sizes
* Multiline items (e.g., http insecure warning) should wrap, not elide,
  and expand the popup height.

BUG: 898927

Change-Id: Ibe50c6ddea98dcdf91bc1d82e548b651ba486b37
Reviewed-on: https://chromium-review.googlesource.com/c/1297400Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarFabio Tirelo <ftirelo@chromium.org>
Commit-Queue: Fabio Tirelo <ftirelo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603179}
parent 9c22b239
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
android:paddingStart="@dimen/autofill_dropdown_refresh_horizontal_padding" android:paddingStart="@dimen/autofill_dropdown_refresh_horizontal_padding"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
tools:ignore="UseCompoundDrawables" > tools:ignore="UseCompoundDrawables" >
<TextView <TextView
...@@ -29,8 +30,9 @@ ...@@ -29,8 +30,9 @@
<ImageView <ImageView
android:id="@+id/dropdown_icon" android:id="@+id/dropdown_icon"
android:layout_width="wrap_content" android:layout_width="@dimen/autofill_dropdown_refresh_icon_width"
android:layout_height="wrap_content" android:layout_height="@dimen/autofill_dropdown_refresh_footer_icon_height"
android:scaleType="centerInside"
android:layout_marginStart="@dimen/autofill_dropdown_refresh_icon_margin" android:layout_marginStart="@dimen/autofill_dropdown_refresh_icon_margin"
android:layout_marginEnd="0dp" android:layout_marginEnd="0dp"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
......
...@@ -46,8 +46,9 @@ ...@@ -46,8 +46,9 @@
<ImageView <ImageView
android:id="@+id/end_dropdown_icon" android:id="@+id/end_dropdown_icon"
android:layout_width="wrap_content" android:layout_width="@dimen/autofill_dropdown_refresh_icon_width"
android:layout_height="wrap_content" android:layout_height="@dimen/autofill_dropdown_refresh_icon_height"
android:scaleType="centerInside"
android:layout_marginStart="@dimen/autofill_dropdown_refresh_icon_margin" android:layout_marginStart="@dimen/autofill_dropdown_refresh_icon_margin"
android:layout_marginEnd="0dp" android:layout_marginEnd="0dp"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
<!-- Dimens for refresh UI --> <!-- Dimens for refresh UI -->
<dimen name="autofill_dropdown_refresh_item_height">48dp</dimen> <dimen name="autofill_dropdown_refresh_item_height">48dp</dimen>
<dimen name="autofill_dropdown_refresh_footer_item_height">40dp</dimen> <dimen name="autofill_dropdown_refresh_footer_item_height">40dp</dimen>
<dimen name="autofill_dropdown_refresh_icon_height">16dp</dimen>
<dimen name="autofill_dropdown_refresh_icon_width">38dp</dimen>
<dimen name="autofill_dropdown_refresh_footer_icon_height">14dp</dimen>
<dimen name="autofill_dropdown_refresh_horizontal_padding">16dp</dimen> <dimen name="autofill_dropdown_refresh_horizontal_padding">16dp</dimen>
<dimen name="autofill_dropdown_refresh_vertical_padding">12dp</dimen>
<dimen name="autofill_dropdown_refresh_icon_margin">24dp</dimen> <dimen name="autofill_dropdown_refresh_icon_margin">24dp</dimen>
</resources> </resources>
...@@ -83,13 +83,27 @@ public class AutofillDropdownAdapter extends ArrayAdapter<DropdownItem> { ...@@ -83,13 +83,27 @@ public class AutofillDropdownAdapter extends ArrayAdapter<DropdownItem> {
DropdownItem item = getItem(position); DropdownItem item = getItem(position);
if (mIsRefresh) { if (mIsRefresh) {
populateLabelView(item, layout); TextView labelView = populateLabelView(item, layout);
populateSublabelView(item, layout); populateSublabelView(item, layout);
ImageView iconView = ImageView iconView =
populateIconView((ImageView) layout.findViewById(R.id.end_dropdown_icon), item); populateIconView((ImageView) layout.findViewById(R.id.end_dropdown_icon), item);
if (iconView != null) { if (iconView != null) {
iconView.setLayoutParams(getSizeParamsForIconView(iconView, item)); iconView.setLayoutParams(getSizeParamsForIconView(iconView, item));
} }
if (item.isMultilineLabel()) {
labelView.setSingleLine(false);
LinearLayout wrapper =
(LinearLayout) layout.findViewById(R.id.dropdown_label_wrapper);
int paddingHeight = mContext.getResources().getDimensionPixelSize(
R.dimen.autofill_dropdown_refresh_vertical_padding);
wrapper.setPadding(
/*left=*/0, /*top=*/paddingHeight, /*right=*/0, /*bottom=*/paddingHeight);
}
return layout; return layout;
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<LinearLayout <LinearLayout
android:id="@+id/dropdown_label_wrapper" android:id="@+id/dropdown_label_wrapper"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical" > android:orientation="vertical" >
......
...@@ -199,7 +199,7 @@ class DropdownPopupWindowJellyBean implements DropdownPopupWindowInterface { ...@@ -199,7 +199,7 @@ class DropdownPopupWindowJellyBean implements DropdownPopupWindowInterface {
mFooterView = footerView; mFooterView = footerView;
if (footerView != null) { if (footerView != null) {
footerView.setLayoutParams(new LinearLayout.LayoutParams( footerView.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
} }
mListPopupWindow.setPromptPosition(ListPopupWindow.POSITION_PROMPT_BELOW); mListPopupWindow.setPromptPosition(ListPopupWindow.POSITION_PROMPT_BELOW);
mListPopupWindow.setPromptView(footerView); mListPopupWindow.setPromptView(footerView);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment