/** Animates this task view as it exits recents */ void startLaunchTaskAnimation( final Runnable postAnimRunnable, boolean isLaunchingTask, boolean occludesLaunchTarget, boolean lockToTask) { if (isLaunchingTask) { // Animate the thumbnail alpha back into full opacity for the window animation out mThumbnailView.startLaunchTaskAnimation(postAnimRunnable); // Animate the dim if (mDimAlpha > 0) { ObjectAnimator anim = ObjectAnimator.ofInt(this, "dim", 0); anim.setDuration(mConfig.taskViewExitToAppDuration); anim.setInterpolator(mConfig.fastOutLinearInInterpolator); anim.start(); } // Animate the action button away if (!lockToTask) { float toScale = 0.9f; mActionButtonView.animate().scaleX(toScale).scaleY(toScale); } mActionButtonView .animate() .alpha(0f) .setStartDelay(0) .setDuration(mConfig.taskViewExitToAppDuration) .setInterpolator(mConfig.fastOutLinearInInterpolator) .withLayer() .start(); } else { // Hide the dismiss button mHeaderView.startLaunchTaskDismissAnimation(); // If this is another view in the task grouping and is in front of the launch task, // animate it away first if (occludesLaunchTarget) { animate() .alpha(0f) .translationY(getTranslationY() + mConfig.taskViewAffiliateGroupEnterOffsetPx) .setStartDelay(0) .setUpdateListener(null) .setInterpolator(mConfig.fastOutLinearInInterpolator) .setDuration(mConfig.taskViewExitToAppDuration) .start(); } } }