From 39cd1d8f0d7414d808abbf3d578a787fc8173a75 Mon Sep 17 00:00:00 2001 From: Doris Ling Date: Thu, 29 Mar 2018 14:55:33 -0700 Subject: [PATCH] Increase touch target for suggestion close button. - wrap the close button icon view in a bigger layout to increase the overall touch area. Fixes: 74220173 Test: manual Change-Id: I45beadf3cfcc6ed1a8a16e6dcb9b8452e1edd78e --- res/layout/suggestion_tile.xml | 23 ++++++++++++++-------- res/layout/suggestion_tile_two_cards.xml | 23 ++++++++++++++-------- res/layout/suggestion_tile_with_button.xml | 22 +++++++++++++-------- .../dashboard/suggestions/SuggestionAdapter.java | 2 +- 4 files changed, 45 insertions(+), 25 deletions(-) diff --git a/res/layout/suggestion_tile.xml b/res/layout/suggestion_tile.xml index 0465b1976b..e4c1b77f32 100644 --- a/res/layout/suggestion_tile.xml +++ b/res/layout/suggestion_tile.xml @@ -47,16 +47,23 @@ android:layout_marginTop="16dp" android:layout_marginBottom="6dp" /> - + android:paddingTop="8dp" + android:paddingEnd="8dp" + android:orientation="horizontal" + android:contentDescription="@string/dlg_close"> + + diff --git a/res/layout/suggestion_tile_two_cards.xml b/res/layout/suggestion_tile_two_cards.xml index c06fb7aabf..15c5004e5f 100644 --- a/res/layout/suggestion_tile_two_cards.xml +++ b/res/layout/suggestion_tile_two_cards.xml @@ -44,16 +44,23 @@ android:layout_marginTop="16dp" android:layout_marginBottom="8dp" /> - + android:gravity="end|top" + android:paddingTop="8dp" + android:paddingEnd="8dp" + android:orientation="horizontal" + android:contentDescription="@string/dlg_close"> + + diff --git a/res/layout/suggestion_tile_with_button.xml b/res/layout/suggestion_tile_with_button.xml index 7cb834a8a4..a901a48491 100644 --- a/res/layout/suggestion_tile_with_button.xml +++ b/res/layout/suggestion_tile_with_button.xml @@ -46,16 +46,22 @@ android:layout_marginTop="16dp" android:layout_marginBottom="6dp" /> - + android:paddingTop="8dp" + android:paddingEnd="8dp" + android:orientation="horizontal" + android:contentDescription="@string/dlg_close"> + + diff --git a/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java b/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java index 13fcb1bd15..9c82eed71f 100644 --- a/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java +++ b/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java @@ -140,7 +140,7 @@ public class SuggestionAdapter extends RecyclerView.Adapter mConfig.setCardLayout(holder, position); } - final ImageView closeButton = holder.itemView.findViewById(R.id.close_button); + final View closeButton = holder.itemView.findViewById(R.id.close_button); if (closeButton != null) { closeButton.setOnClickListener(v -> { mSuggestionFeatureProvider.dismissSuggestion( -- 2.11.0