Merge "Fix large screen QS and QQS lookup. Specially when privacy chip is shown." into tm-qpr-dev am: d7c56b2435
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20982131 Change-Id: I5291a6a24e656ebd1d5730bdff1546ed34c9716a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
|
android:paddingStart="8dp"
|
||||||
>
|
>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
<!-- QS-->
|
<!-- QS-->
|
||||||
<dimen name="qs_panel_padding_top">16dp</dimen>
|
<dimen name="qs_panel_padding_top">16dp</dimen>
|
||||||
|
<dimen name="qs_panel_padding">24dp</dimen>
|
||||||
<dimen name="qs_content_horizontal_padding">24dp</dimen>
|
<dimen name="qs_content_horizontal_padding">24dp</dimen>
|
||||||
<dimen name="qs_horizontal_margin">24dp</dimen>
|
<dimen name="qs_horizontal_margin">24dp</dimen>
|
||||||
<!-- in split shade qs_tiles_page_horizontal_margin should be equal of qs_horizontal_margin/2,
|
<!-- in split shade qs_tiles_page_horizontal_margin should be equal of qs_horizontal_margin/2,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
<!--
|
|
||||||
~ Copyright (C) 2021 The Android Open Source Project
|
~ Copyright (C) 2021 The Android Open Source Project
|
||||||
~
|
~
|
||||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -15,105 +14,73 @@
|
|||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<ConstraintSet
|
<ConstraintSet xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/large_screen_header_constraint">
|
android:id="@+id/large_screen_header_constraint">
|
||||||
|
|
||||||
<Constraint
|
<Constraint android:id="@+id/clock">
|
||||||
android:id="@+id/clock">
|
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/date"
|
app:layout_constraintStart_toEndOf="@id/begin_guide"
|
||||||
app:layout_constraintHorizontal_bias="0"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
/>
|
<PropertySet android:alpha="1" />
|
||||||
<Transform
|
|
||||||
android:scaleX="1"
|
|
||||||
android:scaleY="1"
|
|
||||||
/>
|
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint android:id="@+id/date">
|
||||||
android:id="@+id/date">
|
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/clock"
|
app:layout_constraintStart_toEndOf="@id/clock"
|
||||||
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
<PropertySet android:alpha="1" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0"
|
|
||||||
/>
|
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint android:id="@+id/carrier_group">
|
||||||
android:id="@+id/carrier_group">
|
|
||||||
<Layout
|
<Layout
|
||||||
app:layout_constraintWidth_min="48dp"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constrainedWidth="true"
|
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="end|center_vertical"
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/date"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/clock"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1"
|
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
||||||
/>
|
app:layout_constraintStart_toEndOf="@id/date"
|
||||||
<PropertySet
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:alpha="1"
|
app:layout_constraintWidth_default="wrap"
|
||||||
/>
|
app:layout_constraintWidth_min="48dp" />
|
||||||
|
<PropertySet android:alpha="1" />
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint android:id="@+id/statusIcons">
|
||||||
android:id="@+id/statusIcons">
|
|
||||||
<Layout
|
<Layout
|
||||||
app:layout_constraintHeight_min="@dimen/large_screen_shade_header_min_height"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||||
app:layout_constraintStart_toEndOf="@id/carrier_group"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/clock"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1"
|
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
||||||
/>
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
<PropertySet
|
app:layout_constraintEnd_toEndOf="@id/carrier_group"/>
|
||||||
android:alpha="1"
|
<PropertySet android:alpha="1" />
|
||||||
/>
|
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint android:id="@+id/batteryRemainingIcon">
|
||||||
android:id="@+id/batteryRemainingIcon">
|
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintHeight_min="@dimen/large_screen_shade_header_min_height"
|
app:layout_constraintHeight_min="@dimen/large_screen_shade_header_min_height"
|
||||||
app:layout_constraintStart_toEndOf="@id/statusIcons"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/privacy_container"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/clock"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
/>
|
app:layout_constraintEnd_toStartOf="@id/privacy_container"
|
||||||
<PropertySet
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
android:alpha="1"
|
<PropertySet android:alpha="1" />
|
||||||
/>
|
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint android:id="@+id/privacy_container">
|
||||||
android:id="@+id/privacy_container">
|
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/date"
|
app:layout_constraintEnd_toStartOf="@id/end_guide"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/date"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintStart_toEndOf="@id/batteryRemainingIcon"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
/>
|
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
</ConstraintSet>
|
</ConstraintSet>
|
||||||
@@ -69,7 +69,8 @@ object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstrain
|
|||||||
}
|
}
|
||||||
return ConstraintsChanges(
|
return ConstraintsChanges(
|
||||||
qqsConstraintsChanges = change,
|
qqsConstraintsChanges = change,
|
||||||
qsConstraintsChanges = change
|
qsConstraintsChanges = change,
|
||||||
|
largeScreenConstraintsChanges = change,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
|||||||
QQS_HEADER_CONSTRAINT -> "QQS Header"
|
QQS_HEADER_CONSTRAINT -> "QQS Header"
|
||||||
QS_HEADER_CONSTRAINT -> "QS Header"
|
QS_HEADER_CONSTRAINT -> "QS Header"
|
||||||
LARGE_SCREEN_HEADER_CONSTRAINT -> "Large Screen Header"
|
LARGE_SCREEN_HEADER_CONSTRAINT -> "Large Screen Header"
|
||||||
else -> "Unknown state"
|
else -> "Unknown state $this"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,6 +296,9 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
|||||||
|
|
||||||
override fun onViewAttached() {
|
override fun onViewAttached() {
|
||||||
privacyIconsController.chipVisibilityListener = chipVisibilityListener
|
privacyIconsController.chipVisibilityListener = chipVisibilityListener
|
||||||
|
updateVisibility()
|
||||||
|
updateTransition()
|
||||||
|
|
||||||
if (header is MotionLayout) {
|
if (header is MotionLayout) {
|
||||||
header.setOnApplyWindowInsetsListener(insetListener)
|
header.setOnApplyWindowInsetsListener(insetListener)
|
||||||
clock.addOnLayoutChangeListener { v, _, _, _, _, _, _, _, _ ->
|
clock.addOnLayoutChangeListener { v, _, _, _, _, _, _, _, _ ->
|
||||||
@@ -308,9 +311,6 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
|||||||
dumpManager.registerDumpable(this)
|
dumpManager.registerDumpable(this)
|
||||||
configurationController.addCallback(configurationControllerListener)
|
configurationController.addCallback(configurationControllerListener)
|
||||||
demoModeController.addCallback(demoModeReceiver)
|
demoModeController.addCallback(demoModeReceiver)
|
||||||
|
|
||||||
updateVisibility()
|
|
||||||
updateTransition()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewDetached() {
|
override fun onViewDetached() {
|
||||||
@@ -436,15 +436,14 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
|||||||
header as MotionLayout
|
header as MotionLayout
|
||||||
if (largeScreenActive) {
|
if (largeScreenActive) {
|
||||||
logInstantEvent("Large screen constraints set")
|
logInstantEvent("Large screen constraints set")
|
||||||
header.setTransition(HEADER_TRANSITION_ID)
|
header.setTransition(LARGE_SCREEN_HEADER_TRANSITION_ID)
|
||||||
header.transitionToStart()
|
|
||||||
} else {
|
} else {
|
||||||
logInstantEvent("Small screen constraints set")
|
logInstantEvent("Small screen constraints set")
|
||||||
header.setTransition(HEADER_TRANSITION_ID)
|
header.setTransition(HEADER_TRANSITION_ID)
|
||||||
header.transitionToStart()
|
|
||||||
updatePosition()
|
|
||||||
updateScrollY()
|
|
||||||
}
|
}
|
||||||
|
header.jumpToState(header.startState)
|
||||||
|
updatePosition()
|
||||||
|
updateScrollY()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updatePosition() {
|
private fun updatePosition() {
|
||||||
|
|||||||
@@ -109,11 +109,12 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testEdgeElementsAlignedWithEdge_largeScreen() {
|
fun testEdgeElementsAlignedWithEdge_largeScreen() {
|
||||||
with(largeScreenConstraint) {
|
with(largeScreenConstraint) {
|
||||||
assertThat(getConstraint(R.id.clock).layout.startToStart).isEqualTo(PARENT_ID)
|
assertThat(getConstraint(R.id.clock).layout.startToEnd).isEqualTo(R.id.begin_guide)
|
||||||
assertThat(getConstraint(R.id.clock).layout.horizontalBias).isEqualTo(0f)
|
assertThat(getConstraint(R.id.clock).layout.horizontalBias).isEqualTo(0.5f)
|
||||||
|
|
||||||
assertThat(getConstraint(R.id.privacy_container).layout.endToEnd).isEqualTo(PARENT_ID)
|
assertThat(getConstraint(R.id.privacy_container).layout.endToStart)
|
||||||
assertThat(getConstraint(R.id.privacy_container).layout.horizontalBias).isEqualTo(1f)
|
.isEqualTo(R.id.end_guide)
|
||||||
|
assertThat(getConstraint(R.id.privacy_container).layout.horizontalBias).isEqualTo(0.5f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +220,12 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
|||||||
.isEqualTo(cutoutEnd - padding)
|
.isEqualTo(cutoutEnd - padding)
|
||||||
}
|
}
|
||||||
|
|
||||||
assertThat(changes.largeScreenConstraintsChanges).isNull()
|
with(largeScreenConstraint) {
|
||||||
|
assertThat(getConstraint(R.id.begin_guide).layout.guideBegin)
|
||||||
|
.isEqualTo(cutoutStart - padding)
|
||||||
|
assertThat(getConstraint(R.id.end_guide).layout.guideEnd)
|
||||||
|
.isEqualTo(cutoutEnd - padding)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -246,7 +252,10 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
|||||||
assertThat(getConstraint(R.id.end_guide).layout.guideEnd).isEqualTo(0)
|
assertThat(getConstraint(R.id.end_guide).layout.guideEnd).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
assertThat(changes.largeScreenConstraintsChanges).isNull()
|
with(largeScreenConstraint) {
|
||||||
|
assertThat(getConstraint(R.id.begin_guide).layout.guideBegin).isEqualTo(0)
|
||||||
|
assertThat(getConstraint(R.id.end_guide).layout.guideEnd).isEqualTo(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user