Workaround to force show TaskFragment while back gesture animating.
Unlike Task and ActivityRecord, the TaskFragment won't show it's surface during animating, and the surface can be hide after close transition in Transitions#setupStartState. Bug: 271599041 Test: verify the TaskFragment can show during back gesture animation. Change-Id: I9a3d56d3e6c0cc9f735d82f99fd1fc04c329d690
This commit is contained in:
@@ -862,8 +862,16 @@ class BackNavigationController {
|
||||
WindowContainer target, boolean isOpen) {
|
||||
final BackWindowAnimationAdaptor adaptor =
|
||||
new BackWindowAnimationAdaptor(target, isOpen);
|
||||
target.startAnimation(target.getPendingTransaction(), adaptor, false /* hidden */,
|
||||
ANIMATION_TYPE_PREDICT_BACK);
|
||||
final SurfaceControl.Transaction pt = target.getPendingTransaction();
|
||||
target.startAnimation(pt, adaptor, false /* hidden */, ANIMATION_TYPE_PREDICT_BACK);
|
||||
// Workaround to show TaskFragment which can be hide in Transitions and won't show
|
||||
// during isAnimating.
|
||||
if (isOpen && target.asActivityRecord() != null) {
|
||||
final TaskFragment fragment = target.asActivityRecord().getTaskFragment();
|
||||
if (fragment != null) {
|
||||
pt.show(fragment.mSurfaceControl);
|
||||
}
|
||||
}
|
||||
return adaptor;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user