Merge "Use async callback for unfold overlay synchronization" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
39f02b6fc6
@@ -155,21 +155,22 @@ constructor(
|
|||||||
newRoot.relayout(params) { transaction ->
|
newRoot.relayout(params) { transaction ->
|
||||||
val vsyncId = Choreographer.getSfInstance().vsyncId
|
val vsyncId = Choreographer.getSfInstance().vsyncId
|
||||||
|
|
||||||
backgroundExecutor.execute {
|
// Apply the transaction that contains the first frame of the overlay and apply
|
||||||
// Apply the transaction that contains the first frame of the overlay
|
// another empty transaction with 'vsyncId + 1' to make sure that it is actually
|
||||||
// synchronously and apply another empty transaction with
|
// displayed on the screen. The second transaction is necessary to remove the screen
|
||||||
// 'vsyncId + 1' to make sure that it is actually displayed on
|
// blocker (turn on the brightness) only when the content is actually visible as it
|
||||||
// the screen. The second transaction is necessary to remove the screen blocker
|
// might be presented only in the next frame.
|
||||||
// (turn on the brightness) only when the content is actually visible as it
|
// See b/197538198
|
||||||
// might be presented only in the next frame.
|
transaction
|
||||||
// See b/197538198
|
.setFrameTimelineVsync(vsyncId)
|
||||||
transaction.setFrameTimelineVsync(vsyncId).apply(/* sync */ true)
|
.apply()
|
||||||
|
|
||||||
transaction.setFrameTimelineVsync(vsyncId + 1).apply(/* sync */ true)
|
transaction.setFrameTimelineVsync(vsyncId + 1)
|
||||||
|
.addTransactionCommittedListener(backgroundExecutor) {
|
||||||
Trace.endAsyncSection("UnfoldLightRevealOverlayAnimation#relayout", 0)
|
Trace.endAsyncSection("UnfoldLightRevealOverlayAnimation#relayout", 0)
|
||||||
callback.run()
|
callback.run()
|
||||||
}
|
}
|
||||||
|
.apply()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user