Fix large screen QS header
The problem happened when going form the expanded clock layout (when QS are fully expanded), to the large screen transition layout. This fix sets the header transition to start when on large screens. Without doing this, the transition was staying at the latest progress in the previous constraintSet. Bug: 261791489 Test: presubmits + tested locally Change-Id: Ice698e169b1328c3a83189c268dbac820b564cf7
This commit is contained in:
@@ -124,6 +124,11 @@
|
||||
</KeyFrameSet>
|
||||
</Transition>
|
||||
|
||||
<Transition
|
||||
android:id="@+id/large_screen_header_transition"
|
||||
app:constraintSetStart="@id/large_screen_header_constraint"
|
||||
app:constraintSetEnd="@id/large_screen_header_constraint"/>
|
||||
|
||||
<Include app:constraintSet="@xml/large_screen_shade_header"/>
|
||||
|
||||
<Include app:constraintSet="@xml/qs_header"/>
|
||||
|
||||
@@ -101,6 +101,8 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
@VisibleForTesting
|
||||
internal val HEADER_TRANSITION_ID = R.id.header_transition
|
||||
@VisibleForTesting
|
||||
internal val LARGE_SCREEN_HEADER_TRANSITION_ID = R.id.large_screen_header_transition
|
||||
@VisibleForTesting
|
||||
internal val QQS_HEADER_CONSTRAINT = R.id.qqs_header_constraint
|
||||
@VisibleForTesting
|
||||
internal val QS_HEADER_CONSTRAINT = R.id.qs_header_constraint
|
||||
@@ -429,8 +431,11 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
}
|
||||
header as MotionLayout
|
||||
if (largeScreenActive) {
|
||||
header.getConstraintSet(LARGE_SCREEN_HEADER_CONSTRAINT).applyTo(header)
|
||||
logInstantEvent("Large screen constraints set")
|
||||
header.setTransition(HEADER_TRANSITION_ID)
|
||||
header.transitionToStart()
|
||||
} else {
|
||||
logInstantEvent("Small screen constraints set")
|
||||
header.setTransition(HEADER_TRANSITION_ID)
|
||||
header.transitionToStart()
|
||||
updatePosition()
|
||||
@@ -440,15 +445,19 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
|
||||
private fun updatePosition() {
|
||||
if (header is MotionLayout && !largeScreenActive && visible) {
|
||||
Trace.instantForTrack(
|
||||
TRACE_TAG_APP,
|
||||
"LargeScreenHeaderController - updatePosition",
|
||||
"position: $qsExpandedFraction"
|
||||
)
|
||||
logInstantEvent("updatePosition: $qsExpandedFraction")
|
||||
header.progress = qsExpandedFraction
|
||||
}
|
||||
}
|
||||
|
||||
private fun logInstantEvent(message: String) {
|
||||
Trace.instantForTrack(
|
||||
TRACE_TAG_APP,
|
||||
"LargeScreenHeaderController",
|
||||
message
|
||||
)
|
||||
}
|
||||
|
||||
private fun updateListeners() {
|
||||
qsCarrierGroupController.setListening(visible)
|
||||
if (visible) {
|
||||
|
||||
Reference in New Issue
Block a user