Fix janky multi-window entry animation

am: c5887ea7a0

* commit 'c5887ea7a0b82cc5909743ce14cbda1dcf1dfc82':
  Fix janky multi-window entry animation

Change-Id: Ia9a2f19a4c03978c9d05e1628cb0607e1e267401
This commit is contained in:
Jorim Jaggi
2016-05-17 18:20:55 +00:00
committed by android-build-merger
4 changed files with 13 additions and 9 deletions

View File

@@ -31,6 +31,7 @@ import android.graphics.Region.Op;
import android.opengl.GLUtils;
import android.os.AsyncTask;
import android.os.SystemProperties;
import android.os.Trace;
import android.renderscript.Matrix4f;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
@@ -310,8 +311,6 @@ public class ImageWallpaper extends WallpaperService {
Log.d(TAG, "onSurfaceRedrawNeeded");
}
super.onSurfaceRedrawNeeded(holder);
mLastSurfaceHeight = mLastSurfaceWidth = -1;
drawFrame();
}
@@ -325,6 +324,7 @@ public class ImageWallpaper extends WallpaperService {
return;
}
try {
Trace.traceBegin(Trace.TRACE_TAG_VIEW, "drawWallpaper");
DisplayInfo displayInfo = getDefaultDisplayInfo();
int newRotation = displayInfo.rotation;
@@ -419,6 +419,7 @@ public class ImageWallpaper extends WallpaperService {
drawWallpaperWithCanvas(sh, availw, availh, xPixels, yPixels);
}
} finally {
Trace.traceEnd(Trace.TRACE_TAG_VIEW);
if (FIXED_SIZED_SURFACE && !mIsHwAccelerated) {
// If the surface is fixed-size, we should only need to
// draw it once and then we'll let the window manager

View File

@@ -826,7 +826,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
boolean useThumbnailTransition = (runningTask != null) && !isHomeStackVisible && hasRecentTasks;
// Update the launch state that we need in updateHeaderBarLayout()
launchState.launchedFromHome = !useThumbnailTransition;
launchState.launchedFromHome = !useThumbnailTransition && !mLaunchedWhileDocking;
launchState.launchedFromApp = useThumbnailTransition || mLaunchedWhileDocking;
launchState.launchedViaDockGesture = mLaunchedWhileDocking;
launchState.launchedViaDragGesture = mDraggingInRecents;

View File

@@ -276,12 +276,13 @@ public class TaskStackAnimationHelper {
tv.onStartFrontTaskEnterAnimation(mStackView.mScreenPinningEnabled);
}
} else if (launchState.launchedViaDockGesture) {
// Animate the tasks up
// Animate the tasks up - add some delay to match the divider animation
AnimationProps taskAnimation = new AnimationProps()
.setDuration(AnimationProps.BOUNDS, dockGestureAnimDuration +
(taskIndexFromBack * DOUBLE_FRAME_OFFSET_MS))
.setInterpolator(AnimationProps.BOUNDS,
ENTER_WHILE_DOCKING_INTERPOLATOR)
.setStartDelay(AnimationProps.BOUNDS, 48)
.setListener(postAnimationTrigger.decrementOnAnimationEnd());
postAnimationTrigger.increment();
mStackView.updateTaskViewToTransform(tv, mTmpTransform, taskAnimation);

View File

@@ -1075,11 +1075,13 @@ public class DividerView extends FrameLayout implements OnTouchListener,
mAnimateAfterRecentsDrawn = false;
updateDockSide();
// Delay switching resizing mode because this might cause jank in recents animation
// that's long than this animation.
stopDragging(getCurrentPosition(), mSnapAlgorithm.getMiddleTarget(),
mLongPressEntraceAnimDuration, Interpolators.FAST_OUT_SLOW_IN,
200 /* endDelay */);
post(() -> {
// Delay switching resizing mode because this might cause jank in recents animation
// that's longer than this animation.
stopDragging(getCurrentPosition(), mSnapAlgorithm.getMiddleTarget(),
mLongPressEntraceAnimDuration, Interpolators.FAST_OUT_SLOW_IN,
200 /* endDelay */);
});
}
if (mGrowAfterRecentsDrawn) {
mGrowAfterRecentsDrawn = false;