From 9f1b9d1b136a719f33991b57b03eae3b26103ce9 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Tue, 26 Nov 2024 15:20:57 -0800 Subject: [PATCH] Fix close button in workEDU card not 48dp. Can use insets to make it appear the same small visual but have a 48dp tap target. Since delegating the touch to the 48dp, we can make the imageButton clickable to false as it's instead being used by the 48dp frame. - since there's no rtl catering for insets insets must have equal left and right values. * this means to reduce the end margin of the text to be given to the LEFT inset of the inset_rounded_action_button * reduce end margin of the linearlayout to be given to the right inset of the drawable. bug:379794419 Test manually photos: beforeRTL:https://drive.google.com/file/d/1-DzcjOTywgk6SFjfCX7AVnmfqsIfa1lh/view?usp=sharing afterRTL:https://drive.google.com/file/d/1UERlZ7XdoF0NhFuQE-oMulqgW9sDq9cy/view?usp=sharing before:https://drive.google.com/file/d/1h5_Ljsx1rLyKum1PK7IRwD14ps2SPKC3/view?usp=sharing after:https://drive.google.com/file/d/1b_8rgrC8WlDIdQuO7gOXS0MDNCISfxWr/view?usp=sharing Flag: EXEMPT bug fix Change-Id: I017d4d34ef6e42fa49543c5f787063b061c382dc --- res/drawable/inset_rounded_action_button.xml | 30 ++++++++++++++++++++ res/layout/work_apps_edu.xml | 11 ++++--- res/values/dimens.xml | 7 +++-- 3 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 res/drawable/inset_rounded_action_button.xml diff --git a/res/drawable/inset_rounded_action_button.xml b/res/drawable/inset_rounded_action_button.xml new file mode 100644 index 0000000000..8ae40c07bb --- /dev/null +++ b/res/drawable/inset_rounded_action_button.xml @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/res/layout/work_apps_edu.xml b/res/layout/work_apps_edu.xml index a45d58521d..0e2c19aaab 100644 --- a/res/layout/work_apps_edu.xml +++ b/res/layout/work_apps_edu.xml @@ -25,9 +25,8 @@ android:orientation="horizontal" android:background="@drawable/work_card" android:layout_gravity="center_horizontal" - android:paddingEnd="@dimen/work_card_margin" android:paddingStart="@dimen/work_card_margin" - android:paddingTop="@dimen/work_card_margin" + android:paddingEnd="@dimen/work_card_margin_end" android:paddingBottom="@dimen/work_card_margin" android:id="@+id/wrapper"> + android:layout_marginTop="@dimen/work_edu_card_button_margin_top" + android:gravity="center" + android:background="@drawable/inset_rounded_action_button"> 16dp 16dp 26dp - 32dp + 12dp 1dp + 12dp 24dp + 12dp - 24dp + 48dp 16dp + 12dp 48dp