From 034526003ad476811070aff8d9f17eabefd1bd27 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Thu, 22 Apr 2021 16:35:37 -0400 Subject: [PATCH] New SecurityFooter design Changes: * Footer appears below QSFooter in portrait, QSBH in landscape * In portrait, height is 48dp for one line of text, 88dp for two lines of text. Creates a new layout that inherits from LinearLayout (horizontal) and adjusts its height based on the number of lines of the containing text. Test: manual Test: atest QSSecurityFooterTest Fixes: 186033456 Change-Id: Ia4f9d5c9b4078d790f654dbd4b82d14670985f8d --- .../qs_security_footer_background_stroke.xml | 18 ++ .../qs_security_footer_background.xml | 37 ++++ .../res/layout/quick_qs_status_icons.xml | 8 - ...xml => quick_settings_security_footer.xml} | 43 ++--- .../quick_status_bar_header_date_privacy.xml | 10 ++ packages/SystemUI/res/values-land/dimens.xml | 6 + packages/SystemUI/res/values/attrs.xml | 6 + packages/SystemUI/res/values/dimens.xml | 11 +- packages/SystemUI/res/values/integers.xml | 2 + packages/SystemUI/res/values/styles.xml | 5 + .../src/com/android/systemui/qs/QSPanel.java | 28 +-- .../android/systemui/qs/QSSecurityFooter.java | 42 +++-- .../systemui/qs/dagger/QSFragmentModule.java | 2 +- .../util/DualHeightHorizontalLinearLayout.kt | 170 ++++++++++++++++++ .../systemui/qs/QSSecurityFooterTest.java | 60 +++---- 15 files changed, 353 insertions(+), 95 deletions(-) create mode 100644 packages/SystemUI/res/color/qs_security_footer_background_stroke.xml create mode 100644 packages/SystemUI/res/drawable/qs_security_footer_background.xml rename packages/SystemUI/res/layout/{quick_settings_footer.xml => quick_settings_security_footer.xml} (55%) create mode 100644 packages/SystemUI/src/com/android/systemui/util/DualHeightHorizontalLinearLayout.kt diff --git a/packages/SystemUI/res/color/qs_security_footer_background_stroke.xml b/packages/SystemUI/res/color/qs_security_footer_background_stroke.xml new file mode 100644 index 0000000000000..aa4d4e8c079d3 --- /dev/null +++ b/packages/SystemUI/res/color/qs_security_footer_background_stroke.xml @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/qs_security_footer_background.xml b/packages/SystemUI/res/drawable/qs_security_footer_background.xml new file mode 100644 index 0000000000000..7d370e9f0547f --- /dev/null +++ b/packages/SystemUI/res/drawable/qs_security_footer_background.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/quick_qs_status_icons.xml b/packages/SystemUI/res/layout/quick_qs_status_icons.xml index 1f90476bb3479..d8bb7e607a5dd 100644 --- a/packages/SystemUI/res/layout/quick_qs_status_icons.xml +++ b/packages/SystemUI/res/layout/quick_qs_status_icons.xml @@ -44,14 +44,6 @@ android:layout_weight="1" /> - - - - + android:layout_marginVertical="@dimen/qs_security_footer_vertical_margin" + android:background="@drawable/qs_security_footer_background" + systemui:singleLineHeight="@dimen/qs_security_footer_single_line_height" + systemui:textViewId="@id/footer_text" + > + android:tint="?android:attr/textColorSecondary" /> - + android:maxLines="@integer/qs_security_footer_maxLines" + android:ellipsize="end" + android:textAppearance="@style/TextAppearance.QS.SecurityFooter" + android:textColor="?android:attr/textColorSecondary"/> + android:src="@*android:drawable/ic_chevron_end" + android:tint="?android:attr/textColorSecondary" /> - + diff --git a/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml b/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml index 22cf2cb8cc1a1..d0e3d3cc3945d 100644 --- a/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml +++ b/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml @@ -55,6 +55,16 @@ android:layout_gravity="center_vertical|center_horizontal" android:visibility="gone" /> + + + 44dp + @*android:dimen/quick_qs_offset_height + 14dp + 0dp + 12dp + 28dp + 9dp 9dp diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml index f489fe846ff3a..eb724425b5d8b 100644 --- a/packages/SystemUI/res/values/attrs.xml +++ b/packages/SystemUI/res/values/attrs.xml @@ -189,5 +189,11 @@ + + + + + + diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 0577d46e44021..4f66e5524df17 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -605,13 +605,18 @@ 6dp 32dp 4dp - 16dp - 16dp - 16dp + 20dp 0dp 15dp 14dp + 20dp + 88dp + 48dp + 8dp + 0dp + 28dp + 64dp 24dp diff --git a/packages/SystemUI/res/values/integers.xml b/packages/SystemUI/res/values/integers.xml index b50b5c14b1fad..116403c931b31 100644 --- a/packages/SystemUI/res/values/integers.xml +++ b/packages/SystemUI/res/values/integers.xml @@ -22,6 +22,8 @@ 0 1 + 2 + 2