Putting battery and status icons of shade header in one container
It's just rearranging the views and shouldn't introduce any visual changes. This is first step of implementing hover states for them - they should behave as one unit in that case so it makes sense to have them in one container. Bug: 249859409 Test: CombinedShadeHeaderConstraintsTest Test: check motion when switching between QQS and QS and split shade behaviour Change-Id: I3781c265c7fced21fc4d9554fd4c5f3b003a7924
This commit is contained in:
@@ -74,7 +74,7 @@ frame when animating QS <-> QQS transition
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/barrier"
|
||||
app:barrierDirection="start"
|
||||
app:constraint_referenced_ids="statusIcons,privacy_container" />
|
||||
app:constraint_referenced_ids="shade_header_system_icons,privacy_container" />
|
||||
|
||||
<com.android.systemui.statusbar.policy.Clock
|
||||
android:id="@+id/clock"
|
||||
@@ -108,46 +108,39 @@ frame when animating QS <-> QQS transition
|
||||
<include
|
||||
android:id="@+id/carrier_group"
|
||||
layout="@layout/shade_carrier_group"
|
||||
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"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constrainedWidth="true"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/shade_header_system_icons"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
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"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="@id/clock" />
|
||||
|
||||
<com.android.systemui.statusbar.phone.StatusIconContainer
|
||||
android:id="@+id/statusIcons"
|
||||
app:layout_constraintHeight_min="@dimen/large_screen_shade_header_min_height"
|
||||
android:paddingEnd="@dimen/signal_cluster_battery_padding"
|
||||
<LinearLayout
|
||||
android:id="@+id/shade_header_system_icons"
|
||||
android:layout_width="wrap_content"
|
||||
app:layout_constraintHeight_min="@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"
|
||||
android:clickable="true"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
/>
|
||||
app:layout_constraintEnd_toEndOf="@id/privacy_container"
|
||||
app:layout_constraintTop_toTopOf="@id/clock">
|
||||
|
||||
<com.android.systemui.battery.BatteryMeterView
|
||||
android:id="@+id/batteryRemainingIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||
app:layout_constraintHeight_min="@dimen/large_screen_shade_header_min_height"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:textAppearance="@style/TextAppearance.QS.Status"
|
||||
app:layout_constraintStart_toEndOf="@id/statusIcons"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/clock"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
<com.android.systemui.statusbar.phone.StatusIconContainer
|
||||
android:id="@+id/statusIcons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingEnd="@dimen/signal_cluster_battery_padding" />
|
||||
|
||||
<com.android.systemui.battery.BatteryMeterView
|
||||
android:id="@+id/batteryRemainingIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:textAppearance="@style/TextAppearance.QS.Status" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/privacy_container"
|
||||
|
||||
@@ -51,56 +51,28 @@
|
||||
android:alpha="0"
|
||||
/>
|
||||
<KeyPosition
|
||||
app:motionTarget="@id/shade_header_system_icons"
|
||||
app:keyPositionType="deltaRelative"
|
||||
app:percentX="0"
|
||||
app:percentY="@dimen/percent_displacement_at_fade_out"
|
||||
app:framePosition="@integer/fade_out_complete_frame"
|
||||
app:sizePercent="0"
|
||||
app:curveFit="linear"
|
||||
app:motionTarget="@id/statusIcons" />
|
||||
app:curveFit="linear" />
|
||||
<KeyPosition
|
||||
app:motionTarget="@id/shade_header_system_icons"
|
||||
app:keyPositionType="deltaRelative"
|
||||
app:percentX="1"
|
||||
app:percentY="0.5"
|
||||
app:framePosition="50"
|
||||
app:sizePercent="1"
|
||||
app:curveFit="linear"
|
||||
app:motionTarget="@id/statusIcons" />
|
||||
app:curveFit="linear" />
|
||||
<KeyAttribute
|
||||
app:motionTarget="@id/statusIcons"
|
||||
app:motionTarget="@id/shade_header_system_icons"
|
||||
app:framePosition="@integer/fade_out_complete_frame"
|
||||
android:alpha="0"
|
||||
/>
|
||||
<KeyAttribute
|
||||
app:motionTarget="@id/statusIcons"
|
||||
app:framePosition="@integer/fade_in_start_frame"
|
||||
android:alpha="0"
|
||||
/>
|
||||
<KeyPosition
|
||||
app:keyPositionType="deltaRelative"
|
||||
app:percentX="0"
|
||||
app:percentY="@dimen/percent_displacement_at_fade_out"
|
||||
app:framePosition="@integer/fade_out_complete_frame"
|
||||
app:percentWidth="1"
|
||||
app:percentHeight="1"
|
||||
app:curveFit="linear"
|
||||
app:motionTarget="@id/batteryRemainingIcon" />
|
||||
<KeyPosition
|
||||
app:keyPositionType="deltaRelative"
|
||||
app:percentX="1"
|
||||
app:percentY="0.5"
|
||||
app:framePosition="50"
|
||||
app:percentWidth="1"
|
||||
app:percentHeight="1"
|
||||
app:curveFit="linear"
|
||||
app:motionTarget="@id/batteryRemainingIcon" />
|
||||
<KeyAttribute
|
||||
app:motionTarget="@id/batteryRemainingIcon"
|
||||
app:framePosition="@integer/fade_out_complete_frame"
|
||||
android:alpha="0"
|
||||
/>
|
||||
<KeyAttribute
|
||||
app:motionTarget="@id/batteryRemainingIcon"
|
||||
app:motionTarget="@id/shade_header_system_icons"
|
||||
app:framePosition="@integer/fade_in_start_frame"
|
||||
android:alpha="0"
|
||||
/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
||||
app:layout_constraintEnd_toStartOf="@id/shade_header_system_icons"
|
||||
app:layout_constraintStart_toEndOf="@id/date"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_default="wrap"
|
||||
@@ -53,28 +53,17 @@
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<Constraint android:id="@+id/statusIcons">
|
||||
<Constraint android:id="@+id/shade_header_system_icons">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
||||
app:layout_constraintEnd_toStartOf="@id/privacy_container"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/carrier_group"/>
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<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_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/privacy_container"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<PropertySet android:alpha="1" />
|
||||
</Constraint>
|
||||
|
||||
<Constraint android:id="@+id/privacy_container">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -54,27 +54,12 @@
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/statusIcons">
|
||||
android:id="@+id/shade_header_system_icons">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
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_constraintStart_toEndOf="@id/date"
|
||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/qqs_header_bottom_guideline"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
/>
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/batteryRemainingIcon">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
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_constraintStart_toEndOf="@id/statusIcons"
|
||||
app:layout_constraintEnd_toEndOf="@id/end_guide"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/qqs_header_bottom_guideline"
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
/>
|
||||
</Constraint>
|
||||
|
||||
<!-- LargeScreenShadeHeaderController helps with managing clock width to layout this view -->
|
||||
<!-- ShadeHeaderController helps with managing clock width to layout this view -->
|
||||
<Constraint
|
||||
android:id="@+id/carrier_group">
|
||||
<Layout
|
||||
@@ -78,25 +78,11 @@
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/statusIcons">
|
||||
android:id="@+id/shade_header_system_icons">
|
||||
<Layout
|
||||
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_toStartOf="@id/batteryRemainingIcon"
|
||||
app:layout_constraintTop_toTopOf="@id/date"
|
||||
app:layout_constraintBottom_toBottomOf="@id/date"
|
||||
/>
|
||||
</Constraint>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/batteryRemainingIcon">
|
||||
<Layout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
|
||||
app:layout_constraintWidth_default="wrap"
|
||||
app:layout_constraintHeight_min="@dimen/new_qs_header_non_clickable_element_height"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/date"
|
||||
app:layout_constraintBottom_toBottomOf="@id/date"
|
||||
|
||||
@@ -31,8 +31,7 @@ object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstrain
|
||||
val constraintAlpha = if (visible) 0f else 1f
|
||||
return ConstraintsChanges(
|
||||
qqsConstraintsChanges = {
|
||||
setAlpha(R.id.statusIcons, constraintAlpha)
|
||||
setAlpha(R.id.batteryRemainingIcon, constraintAlpha)
|
||||
setAlpha(R.id.shade_header_system_icons, constraintAlpha)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -45,14 +44,15 @@ object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstrain
|
||||
R.id.barrier,
|
||||
ConstraintSet.START,
|
||||
0,
|
||||
R.id.statusIcons,
|
||||
R.id.shade_header_system_icons,
|
||||
R.id.privacy_container
|
||||
)
|
||||
connect(R.id.statusIcons, ConstraintSet.START, R.id.date, ConstraintSet.END)
|
||||
connect(R.id.shade_header_system_icons, ConstraintSet.START, R.id.date,
|
||||
ConstraintSet.END)
|
||||
connect(R.id.privacy_container, ConstraintSet.START, R.id.date, ConstraintSet.END)
|
||||
constrainWidth(R.id.statusIcons, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
constrainWidth(R.id.shade_header_system_icons, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
constrainedWidth(R.id.date, true)
|
||||
constrainedWidth(R.id.statusIcons, true)
|
||||
constrainedWidth(R.id.shade_header_system_icons, true)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -84,7 +84,7 @@ object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstrain
|
||||
setGuidelineEnd(centerEnd, offsetFromEdge)
|
||||
connect(R.id.date, ConstraintSet.END, centerStart, ConstraintSet.START)
|
||||
connect(
|
||||
R.id.statusIcons,
|
||||
R.id.shade_header_system_icons,
|
||||
ConstraintSet.START,
|
||||
centerEnd,
|
||||
ConstraintSet.END
|
||||
@@ -96,7 +96,7 @@ object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstrain
|
||||
ConstraintSet.END
|
||||
)
|
||||
constrainedWidth(R.id.date, true)
|
||||
constrainedWidth(R.id.statusIcons, true)
|
||||
constrainedWidth(R.id.shade_header_system_icons, true)
|
||||
},
|
||||
qsConstraintsChanges = {
|
||||
setGuidelineBegin(centerStart, offsetFromEdge)
|
||||
|
||||
@@ -62,9 +62,9 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
assertThat(getConstraint(R.id.clock).layout.startToStart).isEqualTo(R.id.begin_guide)
|
||||
assertThat(getConstraint(R.id.clock).layout.horizontalBias).isEqualTo(0f)
|
||||
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).layout.endToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.endToEnd)
|
||||
.isEqualTo(R.id.end_guide)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).layout.horizontalBias)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.horizontalBias)
|
||||
.isEqualTo(1f)
|
||||
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.endToEnd)
|
||||
@@ -95,9 +95,9 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
assertThat(getConstraint(R.id.date).layout.startToStart).isEqualTo(PARENT_ID)
|
||||
assertThat(getConstraint(R.id.date).layout.horizontalBias).isEqualTo(0.5f)
|
||||
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).layout.endToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.endToEnd)
|
||||
.isEqualTo(PARENT_ID)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).layout.horizontalBias)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.horizontalBias)
|
||||
.isEqualTo(0.5f)
|
||||
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.endToEnd)
|
||||
@@ -133,18 +133,15 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
changes()
|
||||
|
||||
with(qqsConstraint) {
|
||||
assertThat(getConstraint(R.id.statusIcons).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(systemIconsAlphaConstraint).isEqualTo(1f)
|
||||
}
|
||||
|
||||
with(qsConstraint) {
|
||||
assertThat(getConstraint(R.id.statusIcons).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(systemIconsAlphaConstraint).isEqualTo(1f)
|
||||
}
|
||||
|
||||
with(largeScreenConstraint) {
|
||||
assertThat(getConstraint(R.id.statusIcons).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(systemIconsAlphaConstraint).isEqualTo(1f)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,18 +152,15 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
changes()
|
||||
|
||||
with(qqsConstraint) {
|
||||
assertThat(getConstraint(R.id.statusIcons).propertySet.alpha).isEqualTo(0f)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).propertySet.alpha).isEqualTo(0f)
|
||||
assertThat(systemIconsAlphaConstraint).isEqualTo(0f)
|
||||
}
|
||||
|
||||
with(qsConstraint) {
|
||||
assertThat(getConstraint(R.id.statusIcons).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(systemIconsAlphaConstraint).isEqualTo(1f)
|
||||
}
|
||||
|
||||
with(largeScreenConstraint) {
|
||||
assertThat(getConstraint(R.id.statusIcons).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(getConstraint(R.id.batteryRemainingIcon).propertySet.alpha).isEqualTo(1f)
|
||||
assertThat(systemIconsAlphaConstraint).isEqualTo(1f)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,12 +175,13 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
|
||||
with(qqsConstraint) {
|
||||
// In this case, the date is constrained on the end by a Barrier determined by either
|
||||
// privacy or statusIcons
|
||||
// privacy or clickableIcons
|
||||
assertThat(getConstraint(R.id.date).layout.endToStart).isEqualTo(R.id.barrier)
|
||||
assertThat(getConstraint(R.id.statusIcons).layout.startToEnd).isEqualTo(R.id.date)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.startToEnd)
|
||||
.isEqualTo(R.id.date)
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.startToEnd).isEqualTo(R.id.date)
|
||||
assertThat(getConstraint(R.id.barrier).layout.mReferenceIds).asList().containsExactly(
|
||||
R.id.statusIcons,
|
||||
R.id.shade_header_system_icons,
|
||||
R.id.privacy_container
|
||||
)
|
||||
assertThat(getConstraint(R.id.barrier).layout.mBarrierDirection).isEqualTo(START)
|
||||
@@ -272,7 +267,7 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
assertThat(getConstraint(R.id.center_left).layout.guideBegin).isEqualTo(offsetFromEdge)
|
||||
assertThat(getConstraint(R.id.center_right).layout.guideEnd).isEqualTo(offsetFromEdge)
|
||||
assertThat(getConstraint(R.id.date).layout.endToStart).isEqualTo(R.id.center_left)
|
||||
assertThat(getConstraint(R.id.statusIcons).layout.startToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.startToEnd)
|
||||
.isEqualTo(R.id.center_right)
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.startToEnd)
|
||||
.isEqualTo(R.id.center_right)
|
||||
@@ -285,9 +280,9 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
assertThat(getConstraint(R.id.date).layout.endToStart).isNotEqualTo(R.id.center_left)
|
||||
assertThat(getConstraint(R.id.date).layout.endToStart).isNotEqualTo(R.id.center_right)
|
||||
|
||||
assertThat(getConstraint(R.id.statusIcons).layout.startToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.startToEnd)
|
||||
.isNotEqualTo(R.id.center_left)
|
||||
assertThat(getConstraint(R.id.statusIcons).layout.startToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.startToEnd)
|
||||
.isNotEqualTo(R.id.center_right)
|
||||
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.startToEnd)
|
||||
@@ -311,7 +306,7 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
assertThat(getConstraint(R.id.center_left).layout.guideEnd).isEqualTo(offsetFromEdge)
|
||||
assertThat(getConstraint(R.id.center_right).layout.guideBegin).isEqualTo(offsetFromEdge)
|
||||
assertThat(getConstraint(R.id.date).layout.endToStart).isEqualTo(R.id.center_right)
|
||||
assertThat(getConstraint(R.id.statusIcons).layout.startToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.startToEnd)
|
||||
.isEqualTo(R.id.center_left)
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.startToEnd)
|
||||
.isEqualTo(R.id.center_left)
|
||||
@@ -324,9 +319,9 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
assertThat(getConstraint(R.id.date).layout.endToStart).isNotEqualTo(R.id.center_left)
|
||||
assertThat(getConstraint(R.id.date).layout.endToStart).isNotEqualTo(R.id.center_right)
|
||||
|
||||
assertThat(getConstraint(R.id.statusIcons).layout.startToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.startToEnd)
|
||||
.isNotEqualTo(R.id.center_left)
|
||||
assertThat(getConstraint(R.id.statusIcons).layout.startToEnd)
|
||||
assertThat(getConstraint(R.id.shade_header_system_icons).layout.startToEnd)
|
||||
.isNotEqualTo(R.id.center_right)
|
||||
|
||||
assertThat(getConstraint(R.id.privacy_container).layout.startToEnd)
|
||||
@@ -382,7 +377,8 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
CombinedShadeHeadersConstraintManagerImpl.emptyCutoutConstraints()()
|
||||
|
||||
assertThat(qqsConstraint.getConstraint(R.id.date).layout.constrainedWidth).isTrue()
|
||||
assertThat(qqsConstraint.getConstraint(R.id.statusIcons).layout.constrainedWidth).isTrue()
|
||||
val shadeHeaderConstraint = qqsConstraint.getConstraint(R.id.shade_header_system_icons)
|
||||
assertThat(shadeHeaderConstraint.layout.constrainedWidth).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -390,9 +386,13 @@ class CombinedShadeHeaderConstraintsTest : SysuiTestCase() {
|
||||
CombinedShadeHeadersConstraintManagerImpl.centerCutoutConstraints(false, 10)()
|
||||
|
||||
assertThat(qqsConstraint.getConstraint(R.id.date).layout.constrainedWidth).isTrue()
|
||||
assertThat(qqsConstraint.getConstraint(R.id.statusIcons).layout.constrainedWidth).isTrue()
|
||||
val shadeHeaderConstraint = qqsConstraint.getConstraint(R.id.shade_header_system_icons)
|
||||
assertThat(shadeHeaderConstraint.layout.constrainedWidth).isTrue()
|
||||
}
|
||||
|
||||
private val ConstraintSet.systemIconsAlphaConstraint
|
||||
get() = getConstraint(R.id.shade_header_system_icons).propertySet.alpha
|
||||
|
||||
private operator fun ConstraintsChanges.invoke() {
|
||||
qqsConstraintsChanges?.invoke(qqsConstraint)
|
||||
qsConstraintsChanges?.invoke(qsConstraint)
|
||||
|
||||
Reference in New Issue
Block a user