summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/res-keyguard/layout/status_bar_mobile_signal_group_inner.xml10
-rw-r--r--packages/SystemUI/res/layout/combined_qs_header.xml3
-rw-r--r--packages/SystemUI/res/layout/status_bar.xml9
-rw-r--r--packages/SystemUI/res/values/dimens.xml23
-rw-r--r--packages/SystemUI/res/xml/qs_header.xml1
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt23
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt41
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt41
8 files changed, 122 insertions, 29 deletions
diff --git a/packages/SystemUI/res-keyguard/layout/status_bar_mobile_signal_group_inner.xml b/packages/SystemUI/res-keyguard/layout/status_bar_mobile_signal_group_inner.xml
index 8f1323db299d..a1e2dc36278b 100644
--- a/packages/SystemUI/res-keyguard/layout/status_bar_mobile_signal_group_inner.xml
+++ b/packages/SystemUI/res-keyguard/layout/status_bar_mobile_signal_group_inner.xml
@@ -54,7 +54,7 @@
</FrameLayout>
<ImageView
android:id="@+id/mobile_type"
- android:layout_height="@dimen/status_bar_mobile_signal_size"
+ android:layout_height="@dimen/status_bar_mobile_type_size"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:adjustViewBounds="true"
@@ -74,13 +74,15 @@
<com.android.systemui.statusbar.AnimatedImageView
android:id="@+id/mobile_signal"
android:layout_height="@dimen/status_bar_mobile_signal_size"
- android:layout_width="@dimen/status_bar_mobile_signal_size"
+ android:layout_width="wrap_content"
+ android:adjustViewBounds="true"
systemui:hasOverlappingRendering="false"
/>
<ImageView
android:id="@+id/mobile_roaming"
- android:layout_width="@dimen/status_bar_mobile_signal_size"
- android:layout_height="@dimen/status_bar_mobile_signal_size"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/status_bar_mobile_roam_size"
+ android:adjustViewBounds="true"
android:layout_gravity="top|start"
android:src="@drawable/stat_sys_roaming"
android:contentDescription="@string/data_connection_roaming"
diff --git a/packages/SystemUI/res/layout/combined_qs_header.xml b/packages/SystemUI/res/layout/combined_qs_header.xml
index f3a6bbeaaf0e..12f13e9a2138 100644
--- a/packages/SystemUI/res/layout/combined_qs_header.xml
+++ b/packages/SystemUI/res/layout/combined_qs_header.xml
@@ -133,7 +133,8 @@ frame when animating QS <-> QQS transition
<com.android.systemui.statusbar.phone.StatusIconContainer
android:id="@+id/statusIcons"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/signal_cluster_battery_padding" />
diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml
index 0ab921f4d555..5132e57e2786 100644
--- a/packages/SystemUI/res/layout/status_bar.xml
+++ b/packages/SystemUI/res/layout/status_bar.xml
@@ -67,6 +67,7 @@
android:id="@+id/status_bar_start_side_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical|start"
android:clipChildren="false">
<include layout="@layout/heads_up_status_bar_layout" />
@@ -88,7 +89,8 @@
<com.android.systemui.statusbar.policy.Clock
android:id="@+id/clock"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="@dimen/status_bar_system_icons_height"
+ android:layout_gravity="center_vertical"
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
android:singleLine="true"
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
@@ -146,7 +148,10 @@
android:layout_marginEnd="@dimen/status_bar_user_chip_end_margin"
layout="@layout/status_bar_user_chip_container" />
- <include layout="@layout/system_icons" />
+ <include layout="@layout/system_icons"
+ android:layout_gravity="center_vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/status_bar_system_icons_height" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</FrameLayout>
</LinearLayout>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 9bee9725d747..a0564450381b 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -121,6 +121,9 @@
<dimen name="navigation_edge_cancelled_arrow_height">0dp</dimen>
<dimen name="navigation_edge_cancelled_edge_corners">6dp</dimen>
+ <!-- Height of the system icons container view in the status bar -->
+ <dimen name="status_bar_system_icons_height">@dimen/status_bar_icon_size_sp</dimen>
+
<!-- New sp height of notification icons in the status bar -->
<dimen name="status_bar_icon_size_sp">@*android:dimen/status_bar_icon_size_sp</dimen>
<!-- Original dp height of notification icons in the status bar -->
@@ -162,13 +165,21 @@
<!-- Size of the view displaying the wifi inout icon in the status bar. -->
<dimen name="status_bar_wifi_inout_container_size">17sp</dimen>
- <!-- Size of the view displaying the wifi signal icon in the status bar. -->
- <dimen name="status_bar_wifi_signal_size">13sp</dimen>
+ <!-- Size of the view displaying the wifi signal icon in the status bar. This value should
+ match the core/status_bar_system_icon_size and change to sp unit -->
+ <dimen name="status_bar_wifi_signal_size">15sp</dimen>
<!-- Size of the view displaying the mobile inout icon in the status bar. -->
<dimen name="status_bar_mobile_inout_container_size">17sp</dimen>
- <!-- Size of the view displaying the mobile signal icon in the status bar. -->
- <dimen name="status_bar_mobile_signal_size">13sp</dimen>
+ <!-- Size of the view displaying the mobile signal icon in the status bar. This value should
+ match the core/status_bar_system_icon_size and change to sp unit -->
+ <dimen name="status_bar_mobile_signal_size">15sp</dimen>
+ <!-- Size of the view displaying the mobile signal icon in the status bar. This value should
+ match the viewport height of mobile signal drawables such as ic_lte_mobiledata -->
+ <dimen name="status_bar_mobile_type_size">16sp</dimen>
+ <!-- Size of the view displaying the mobile roam icon in the status bar. This value should
+ match the viewport size of drawable stat_sys_roaming -->
+ <dimen name="status_bar_mobile_roam_size">8sp</dimen>
<!-- Spacing before the airplane mode icon if there are any icons preceding it. -->
<dimen name="status_bar_airplane_spacer_width">4sp</dimen>
@@ -343,8 +354,8 @@
<dimen name="status_bar_icons_padding_start">11dp</dimen>
<dimen name="status_bar_icons_padding_end">0dp</dimen>
- <dimen name="status_bar_icons_padding_bottom">8dp</dimen>
- <dimen name="status_bar_icons_padding_top">8dp</dimen>
+ <dimen name="status_bar_icons_padding_bottom">0dp</dimen>
+ <dimen name="status_bar_icons_padding_top">0dp</dimen>
<!-- gap on either side of status bar notification icons -->
<dimen name="status_bar_icon_horizontal_margin">0sp</dimen>
diff --git a/packages/SystemUI/res/xml/qs_header.xml b/packages/SystemUI/res/xml/qs_header.xml
index 7b4282f049b8..427fd87c640a 100644
--- a/packages/SystemUI/res/xml/qs_header.xml
+++ b/packages/SystemUI/res/xml/qs_header.xml
@@ -83,6 +83,7 @@
android:layout_width="0dp"
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
app:layout_constraintWidth_default="wrap"
+ app:layout_constraintStart_toEndOf="@id/date"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/date"
app:layout_constraintBottom_toBottomOf="@id/date"
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt b/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
index 5c1dd5670d8a..941254223965 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
@@ -155,10 +155,8 @@ class NotificationsQSContainerController @Inject constructor(
largeScreenShadeHeaderActive = LargeScreenUtils.shouldUseLargeScreenShadeHeader(resources)
notificationsBottomMargin = resources.getDimensionPixelSize(
R.dimen.notification_panel_margin_bottom)
- largeScreenShadeHeaderHeight =
- resources.getDimensionPixelSize(R.dimen.large_screen_shade_header_height)
- shadeHeaderHeight =
- resources.getDimensionPixelSize(R.dimen.qs_header_height)
+ largeScreenShadeHeaderHeight = calculateLargeShadeHeaderHeight()
+ shadeHeaderHeight = calculateShadeHeaderHeight()
panelMarginHorizontal = resources.getDimensionPixelSize(
R.dimen.notification_panel_margin_horizontal)
topMargin = if (largeScreenShadeHeaderActive) {
@@ -182,6 +180,23 @@ class NotificationsQSContainerController @Inject constructor(
}
}
+ private fun calculateLargeShadeHeaderHeight(): Int {
+ return resources.getDimensionPixelSize(R.dimen.large_screen_shade_header_height)
+ }
+
+ private fun calculateShadeHeaderHeight(): Int {
+ val minHeight = resources.getDimensionPixelSize(R.dimen.qs_header_height)
+
+ // Following the constraints in xml/qs_header, the total needed height would be the sum of
+ // 1. privacy_container height (R.dimen.large_screen_shade_header_min_height)
+ // 2. carrier_group height (R.dimen.large_screen_shade_header_min_height)
+ // 3. date height (R.dimen.new_qs_header_non_clickable_element_height)
+ val estimatedHeight =
+ 2 * resources.getDimensionPixelSize(R.dimen.large_screen_shade_header_min_height) +
+ resources.getDimensionPixelSize(R.dimen.new_qs_header_non_clickable_element_height)
+ return estimatedHeight.coerceAtLeast(minHeight)
+ }
+
override fun setCustomizerAnimating(animating: Boolean) {
if (isQSCustomizerAnimating != animating) {
isQSCustomizerAnimating = animating
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
index 2bc112d68ae2..112a09bcfe62 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
@@ -144,27 +144,52 @@ class NotificationsQSContainerControllerLegacyTest : SysuiTestCase() {
@Test
fun testSmallScreen_updateResources_splitShadeHeightIsSet() {
overrideResource(R.bool.config_use_large_screen_shade_header, false)
- overrideResource(R.dimen.qs_header_height, 1)
- overrideResource(R.dimen.large_screen_shade_header_height, 2)
+ overrideResource(R.dimen.qs_header_height, 10)
+ overrideResource(R.dimen.large_screen_shade_header_height, 20)
+
+ // ensure the estimated height (would be 3 here) wouldn't impact this test case
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 1)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 1)
underTest.updateResources()
val captor = ArgumentCaptor.forClass(ConstraintSet::class.java)
verify(view).applyConstraints(capture(captor))
- assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(1)
+ assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(10)
}
@Test
fun testLargeScreen_updateResources_splitShadeHeightIsSet() {
overrideResource(R.bool.config_use_large_screen_shade_header, true)
- overrideResource(R.dimen.qs_header_height, 1)
- overrideResource(R.dimen.large_screen_shade_header_height, 2)
+ overrideResource(R.dimen.qs_header_height, 10)
+ overrideResource(R.dimen.large_screen_shade_header_height, 20)
+
+ // ensure the estimated height (would be 3 here) wouldn't impact this test case
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 1)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 1)
underTest.updateResources()
val captor = ArgumentCaptor.forClass(ConstraintSet::class.java)
verify(view).applyConstraints(capture(captor))
- assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(2)
+ assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(20)
+ }
+
+ @Test
+ fun testSmallScreen_estimatedHeightIsLargerThanDimenValue_shadeHeightIsSetToEstimatedHeight() {
+ overrideResource(R.bool.config_use_large_screen_shade_header, false)
+ overrideResource(R.dimen.qs_header_height, 10)
+ overrideResource(R.dimen.large_screen_shade_header_height, 20)
+
+ // make the estimated height (would be 15 here) larger than qs_header_height
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 5)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 5)
+
+ underTest.updateResources()
+
+ val captor = ArgumentCaptor.forClass(ConstraintSet::class.java)
+ verify(view).applyConstraints(capture(captor))
+ assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(15)
}
@Test
@@ -388,6 +413,10 @@ class NotificationsQSContainerControllerLegacyTest : SysuiTestCase() {
val largeScreenHeaderHeight = 100
overrideResource(R.dimen.large_screen_shade_header_height, largeScreenHeaderHeight)
+ // ensure the estimated height (would be 30 here) wouldn't impact this test case
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 10)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 10)
+
underTest.updateResources()
assertThat(getConstraintSetLayout(R.id.qs_frame).topMargin)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
index a5048187b1b4..8d3c4b21aa26 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
@@ -143,27 +143,52 @@ class NotificationsQSContainerControllerTest : SysuiTestCase() {
@Test
fun testSmallScreen_updateResources_splitShadeHeightIsSet() {
overrideResource(R.bool.config_use_large_screen_shade_header, false)
- overrideResource(R.dimen.qs_header_height, 1)
- overrideResource(R.dimen.large_screen_shade_header_height, 2)
+ overrideResource(R.dimen.qs_header_height, 10)
+ overrideResource(R.dimen.large_screen_shade_header_height, 20)
+
+ // ensure the estimated height (would be 3 here) wouldn't impact this test case
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 1)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 1)
underTest.updateResources()
val captor = ArgumentCaptor.forClass(ConstraintSet::class.java)
verify(view).applyConstraints(capture(captor))
- assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(1)
+ assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(10)
}
@Test
fun testLargeScreen_updateResources_splitShadeHeightIsSet() {
overrideResource(R.bool.config_use_large_screen_shade_header, true)
- overrideResource(R.dimen.qs_header_height, 1)
- overrideResource(R.dimen.large_screen_shade_header_height, 2)
+ overrideResource(R.dimen.qs_header_height, 10)
+ overrideResource(R.dimen.large_screen_shade_header_height, 20)
+
+ // ensure the estimated height (would be 3 here) wouldn't impact this test case
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 1)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 1)
underTest.updateResources()
val captor = ArgumentCaptor.forClass(ConstraintSet::class.java)
verify(view).applyConstraints(capture(captor))
- assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(2)
+ assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(20)
+ }
+
+ @Test
+ fun testSmallScreen_estimatedHeightIsLargerThanDimenValue_shadeHeightIsSetToEstimatedHeight() {
+ overrideResource(R.bool.config_use_large_screen_shade_header, false)
+ overrideResource(R.dimen.qs_header_height, 10)
+ overrideResource(R.dimen.large_screen_shade_header_height, 20)
+
+ // make the estimated height (would be 15 here) larger than qs_header_height
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 5)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 5)
+
+ underTest.updateResources()
+
+ val captor = ArgumentCaptor.forClass(ConstraintSet::class.java)
+ verify(view).applyConstraints(capture(captor))
+ assertThat(captor.value.getHeight(R.id.split_shade_status_bar)).isEqualTo(15)
}
@Test
@@ -376,6 +401,10 @@ class NotificationsQSContainerControllerTest : SysuiTestCase() {
val largeScreenHeaderHeight = 100
overrideResource(R.dimen.large_screen_shade_header_height, largeScreenHeaderHeight)
+ // ensure the estimated height (would be 30 here) wouldn't impact this test case
+ overrideResource(R.dimen.large_screen_shade_header_min_height, 10)
+ overrideResource(R.dimen.new_qs_header_non_clickable_element_height, 10)
+
underTest.updateResources()
assertThat(getConstraintSetLayout(R.id.qs_frame).topMargin)