Merge "Prevent views from changing size in animation" into tm-qpr-dev am: ba9c3d6406
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20454205 Change-Id: Idc16852470ee6a468e1c90459171194791f883dd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
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="@dimen/large_screen_shade_header_min_height"
|
||||||
app:layout_constraintStart_toStartOf="@id/begin_guide"
|
app:layout_constraintStart_toStartOf="@id/begin_guide"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/date">
|
android:id="@+id/date">
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/statusIcons">
|
android:id="@+id/statusIcons">
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
||||||
app:layout_constraintHeight_min="@dimen/new_qs_header_non_clickable_element_height"
|
app:layout_constraintHeight_min="@dimen/new_qs_header_non_clickable_element_height"
|
||||||
app:layout_constraintStart_toEndOf="@id/date"
|
app:layout_constraintStart_toEndOf="@id/date"
|
||||||
@@ -65,6 +65,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1"
|
app:layout_constraintHorizontal_bias="1"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
/>
|
/>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
@@ -80,12 +81,16 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1"
|
app:layout_constraintHorizontal_bias="1"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
/>
|
/>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/carrier_group">
|
android:id="@+id/carrier_group">
|
||||||
<Layout
|
<Layout
|
||||||
|
app:layout_constraintWidth_min="48dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="@id/carrier_group"
|
app:layout_constraintBottom_toBottomOf="@id/carrier_group"
|
||||||
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
||||||
app:layout_constraintHorizontal_bias="0"
|
app:layout_constraintHorizontal_bias="0"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||||
/>
|
/>
|
||||||
<Transform
|
<Transform
|
||||||
android:scaleX="2.57"
|
android:scaleX="2.57"
|
||||||
@@ -53,7 +54,7 @@
|
|||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/date">
|
android:id="@+id/date">
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/space"
|
app:layout_constraintEnd_toStartOf="@id/space"
|
||||||
@@ -67,16 +68,15 @@
|
|||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/carrier_group">
|
android:id="@+id/carrier_group">
|
||||||
<Layout
|
<Layout
|
||||||
app:layout_constraintHeight_min="@dimen/large_screen_shade_header_min_height"
|
|
||||||
android:minHeight="@dimen/large_screen_shade_header_min_height"
|
|
||||||
app:layout_constraintWidth_min="48dp"
|
app:layout_constraintWidth_min="48dp"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||||
app:layout_constraintStart_toEndOf="@id/clock"
|
app:layout_constraintStart_toEndOf="@id/clock"
|
||||||
app:layout_constraintTop_toBottomOf="@id/privacy_container"
|
app:layout_constraintTop_toBottomOf="@id/privacy_container"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1"
|
app:layout_constraintHorizontal_bias="1"
|
||||||
app:layout_constraintBottom_toTopOf="@id/batteryRemainingIcon"
|
app:layout_constraintBottom_toTopOf="@id/batteryRemainingIcon"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||||
/>
|
/>
|
||||||
<PropertySet
|
<PropertySet
|
||||||
android:alpha="1"
|
android:alpha="1"
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/statusIcons">
|
android:id="@+id/statusIcons">
|
||||||
<Layout
|
<Layout
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintStart_toEndOf="@id/space"
|
app:layout_constraintStart_toEndOf="@id/space"
|
||||||
@@ -108,6 +108,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="@id/date"
|
app:layout_constraintTop_toTopOf="@id/date"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1"
|
app:layout_constraintHorizontal_bias="1"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||||
/>
|
/>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstrain
|
|||||||
centerEnd,
|
centerEnd,
|
||||||
ConstraintSet.END
|
ConstraintSet.END
|
||||||
)
|
)
|
||||||
constrainWidth(R.id.statusIcons, 0)
|
|
||||||
},
|
},
|
||||||
qsConstraintsChanges = {
|
qsConstraintsChanges = {
|
||||||
setGuidelineBegin(centerStart, offsetFromEdge)
|
setGuidelineBegin(centerStart, offsetFromEdge)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import androidx.test.filters.SmallTest
|
|||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.SysuiTestCase
|
import com.android.systemui.SysuiTestCase
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
|
import com.google.common.truth.Truth.assertWithMessage
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
@@ -320,6 +321,48 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
|||||||
assertThat(changes.largeScreenConstraintsChanges).isNull()
|
assertThat(changes.largeScreenConstraintsChanges).isNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testRelevantViewsAreNotMatchConstraints() {
|
||||||
|
val views = mapOf(
|
||||||
|
R.id.clock to "clock",
|
||||||
|
R.id.date to "date",
|
||||||
|
R.id.statusIcons to "icons",
|
||||||
|
R.id.privacy_container to "privacy",
|
||||||
|
R.id.carrier_group to "carriers",
|
||||||
|
R.id.batteryRemainingIcon to "battery",
|
||||||
|
)
|
||||||
|
views.forEach { (id, name) ->
|
||||||
|
assertWithMessage("$name has 0 height in qqs")
|
||||||
|
.that(qqsConstraint.getConstraint(id).layout.mHeight).isNotEqualTo(0)
|
||||||
|
assertWithMessage("$name has 0 width in qqs")
|
||||||
|
.that(qqsConstraint.getConstraint(id).layout.mWidth).isNotEqualTo(0)
|
||||||
|
assertWithMessage("$name has 0 height in qs")
|
||||||
|
.that(qsConstraint.getConstraint(id).layout.mHeight).isNotEqualTo(0)
|
||||||
|
assertWithMessage("$name has 0 width in qs")
|
||||||
|
.that(qsConstraint.getConstraint(id).layout.mWidth).isNotEqualTo(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testCheckViewsDontChangeSizeBetweenAnimationConstraints() {
|
||||||
|
val views = mapOf(
|
||||||
|
R.id.clock to "clock",
|
||||||
|
R.id.date to "date",
|
||||||
|
R.id.statusIcons to "icons",
|
||||||
|
R.id.privacy_container to "privacy",
|
||||||
|
R.id.carrier_group to "carriers",
|
||||||
|
R.id.batteryRemainingIcon to "battery",
|
||||||
|
)
|
||||||
|
views.forEach { (id, name) ->
|
||||||
|
assertWithMessage("$name changes height")
|
||||||
|
.that(qqsConstraint.getConstraint(id).layout.mHeight)
|
||||||
|
.isEqualTo(qsConstraint.getConstraint(id).layout.mHeight)
|
||||||
|
assertWithMessage("$name changes width")
|
||||||
|
.that(qqsConstraint.getConstraint(id).layout.mWidth)
|
||||||
|
.isEqualTo(qsConstraint.getConstraint(id).layout.mWidth)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private operator fun ConstraintsChanges.invoke() {
|
private operator fun ConstraintsChanges.invoke() {
|
||||||
qqsConstraintsChanges?.invoke(qqsConstraint)
|
qqsConstraintsChanges?.invoke(qqsConstraint)
|
||||||
qsConstraintsChanges?.invoke(qsConstraint)
|
qsConstraintsChanges?.invoke(qsConstraint)
|
||||||
|
|||||||
Reference in New Issue
Block a user