mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Workaround for flicker between handoff from app to task view
- Defer finishing the recents animation for a couple frames until the frame has likely been pushed to sf and drawn, otherwise the reparenting of the app surface may happen before the task view is visible in Launcher. Bug: 111299394 Test: Swipe up repeatedly from an app Change-Id: I627dc085a5e376436b2b8eb5841c45fd36deff42
This commit is contained in:
@@ -882,8 +882,21 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
|
||||
// new thumbnail
|
||||
finishTransitionPosted = new WindowCallbacksCompat(taskView) {
|
||||
|
||||
// The number of frames to defer until we actually finish the animation
|
||||
private int mDeferFrameCount = 2;
|
||||
|
||||
@Override
|
||||
public void onPostDraw(Canvas canvas) {
|
||||
if (mDeferFrameCount > 0) {
|
||||
mDeferFrameCount--;
|
||||
// Workaround, detach and reattach to invalidate the root node for
|
||||
// another draw
|
||||
detach();
|
||||
attach();
|
||||
taskView.invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
setStateOnUiThread(STATE_SCREENSHOT_CAPTURED);
|
||||
detach();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user