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:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="8dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
<!-- QS-->
|
||||
<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_horizontal_margin">24dp</dimen>
|
||||
<!-- 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
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -15,105 +14,73 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<ConstraintSet
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ConstraintSet xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/large_screen_header_constraint">
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/clock">
|
||||
<Constraint android:id="@+id/clock">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/date"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
/>
|
||||
<Transform
|
||||
android:scaleX="1"
|
||||
android:scaleY="1"
|
||||
/>
|
||||
app:layout_constraintStart_toEndOf="@id/begin_guide"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/date">
|
||||
<Constraint android:id="@+id/date">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/clock"
|
||||
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/carrier_group">
|
||||
<Constraint android:id="@+id/carrier_group">
|
||||
<Layout
|
||||
app:layout_constraintWidth_min="48dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constrainedWidth="true"
|
||||
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_constraintHorizontal_bias="1"
|
||||
/>
|
||||
<PropertySet
|
||||
android:alpha="1"
|
||||
/>
|
||||
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
||||
app:layout_constraintStart_toEndOf="@id/date"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_default="wrap"
|
||||
app:layout_constraintWidth_min="48dp" />
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/statusIcons">
|
||||
<Constraint android:id="@+id/statusIcons">
|
||||
<Layout
|
||||
app:layout_constraintHeight_min="@dimen/large_screen_shade_header_min_height"
|
||||
android:layout_width="wrap_content"
|
||||
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_constraintHorizontal_bias="1"
|
||||
/>
|
||||
<PropertySet
|
||||
android:alpha="1"
|
||||
/>
|
||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/carrier_group"/>
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/batteryRemainingIcon">
|
||||
<Constraint android:id="@+id/batteryRemainingIcon">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
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"
|
||||
/>
|
||||
<PropertySet
|
||||
android:alpha="1"
|
||||
/>
|
||||
app:layout_constraintEnd_toStartOf="@id/privacy_container"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/privacy_container">
|
||||
<Constraint android:id="@+id/privacy_container">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/date"
|
||||
app:layout_constraintBottom_toBottomOf="@id/date"
|
||||
app:layout_constraintStart_toEndOf="@id/batteryRemainingIcon"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/end_guide"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</Constraint>
|
||||
|
||||
</ConstraintSet>
|
||||
@@ -69,7 +69,8 @@ object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstrain
|
||||
}
|
||||
return ConstraintsChanges(
|
||||
qqsConstraintsChanges = change,
|
||||
qsConstraintsChanges = change
|
||||
qsConstraintsChanges = change,
|
||||
largeScreenConstraintsChanges = change,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
QQS_HEADER_CONSTRAINT -> "QQS Header"
|
||||
QS_HEADER_CONSTRAINT -> "QS 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() {
|
||||
privacyIconsController.chipVisibilityListener = chipVisibilityListener
|
||||
updateVisibility()
|
||||
updateTransition()
|
||||
|
||||
if (header is MotionLayout) {
|
||||
header.setOnApplyWindowInsetsListener(insetListener)
|
||||
clock.addOnLayoutChangeListener { v, _, _, _, _, _, _, _, _ ->
|
||||
@@ -308,9 +311,6 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
dumpManager.registerDumpable(this)
|
||||
configurationController.addCallback(configurationControllerListener)
|
||||
demoModeController.addCallback(demoModeReceiver)
|
||||
|
||||
updateVisibility()
|
||||
updateTransition()
|
||||
}
|
||||
|
||||
override fun onViewDetached() {
|
||||
@@ -436,15 +436,14 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
header as MotionLayout
|
||||
if (largeScreenActive) {
|
||||
logInstantEvent("Large screen constraints set")
|
||||
header.setTransition(HEADER_TRANSITION_ID)
|
||||
header.transitionToStart()
|
||||
header.setTransition(LARGE_SCREEN_HEADER_TRANSITION_ID)
|
||||
} else {
|
||||
logInstantEvent("Small screen constraints set")
|
||||
header.setTransition(HEADER_TRANSITION_ID)
|
||||
header.transitionToStart()
|
||||
updatePosition()
|
||||
updateScrollY()
|
||||
}
|
||||
header.jumpToState(header.startState)
|
||||
updatePosition()
|
||||
updateScrollY()
|
||||
}
|
||||
|
||||
private fun updatePosition() {
|
||||
|
||||
@@ -109,11 +109,12 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun testEdgeElementsAlignedWithEdge_largeScreen() {
|
||||
with(largeScreenConstraint) {
|
||||
assertThat(getConstraint(R.id.clock).layout.startToStart).isEqualTo(PARENT_ID)
|
||||
assertThat(getConstraint(R.id.clock).layout.horizontalBias).isEqualTo(0f)
|
||||
assertThat(getConstraint(R.id.clock).layout.startToEnd).isEqualTo(R.id.begin_guide)
|
||||
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.horizontalBias).isEqualTo(1f)
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.endToStart)
|
||||
.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)
|
||||
}
|
||||
|
||||
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
|
||||
@@ -246,7 +252,10 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user