Loading packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ <dimen name="recents_search_bar_space_height">64dp</dimen> <!-- The side padding for the task stack as a percentage of the width. --> <item name="recents_stack_width_padding_percentage" format="float" type="dimen">0.04444</item> <item name="recents_stack_width_padding_percentage" format="float" type="dimen">0.03333</item> <!-- The overscroll percentage allowed on the stack. --> <item name="recents_stack_overscroll_percentage" format="float" type="dimen">0.0875</item> Loading packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +6 −52 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; /** A proxy implementation for the recents component */ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationStartedListener { public class AlternateRecentsComponent { final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome"; final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome"; Loading @@ -63,7 +63,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab"; final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey"; final public static String ACTION_START_ENTER_ANIMATION = "action_start_enter_animation"; final public static String ACTION_TOGGLE_RECENTS_ACTIVITY = "action_toggle_recents_activity"; final public static String ACTION_HIDE_RECENTS_ACTIVITY = "action_hide_recents_activity"; Loading @@ -78,9 +77,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta Context mContext; LayoutInflater mInflater; SystemServicesProxy mSystemServicesProxy; Handler mHandler; boolean mBootCompleted; boolean mStartAnimationTriggered; // Task launching RecentsConfiguration mConfig; Loading @@ -106,7 +103,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta mInflater = LayoutInflater.from(context); mContext = context; mSystemServicesProxy = new SystemServicesProxy(context); mHandler = new Handler(); mTaskStackBounds = new Rect(); } Loading Loading @@ -364,30 +360,27 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta * Creates the activity options for a unknown state->recents transition. */ ActivityOptions getUnknownTransitionActivityOptions() { mStartAnimationTriggered = false; return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_unknown_enter, R.anim.recents_from_unknown_exit, mHandler, this); R.anim.recents_from_unknown_exit); } /** * Creates the activity options for a home->recents transition. */ ActivityOptions getHomeTransitionActivityOptions(boolean fromSearchHome) { mStartAnimationTriggered = false; if (fromSearchHome) { return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_search_launcher_enter, R.anim.recents_from_search_launcher_exit, mHandler, this); R.anim.recents_from_search_launcher_exit); } return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_launcher_enter, R.anim.recents_from_launcher_exit, mHandler, this); R.anim.recents_from_launcher_exit); } /** * Creates the activity options for an app->recents transition. If this method sets the static * screenshot, then we will use that for the transition. * Creates the activity options for an app->recents transition. */ ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) { Loading @@ -411,10 +404,9 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta c.setBitmap(null); } mStartAnimationTriggered = false; return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mStatusBarView, thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(), toTaskRect.height(), this); toTaskRect.height(), null); } // If both the screenshot and thumbnail fails, then just fall back to the default transition Loading Loading @@ -551,42 +543,4 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta sRecentsComponentCallbacks.onVisibilityChanged(visible); } } /**** OnAnimationStartedListener Implementation ****/ @Override public void onAnimationStarted() { // Notify recents to start the enter animation if (!mStartAnimationTriggered) { // There can be a race condition between the start animation callback and // the start of the new activity (where we register the receiver that listens // to this broadcast, so we add our own receiver and if that gets called, then // we know the activity has not yet started and we can retry sending the broadcast. BroadcastReceiver fallbackReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (getResultCode() == Activity.RESULT_OK) { mStartAnimationTriggered = true; return; } // Schedule for the broadcast to be sent again after some time mHandler.postDelayed(new Runnable() { @Override public void run() { onAnimationStarted(); } }, 75); } }; // Send the broadcast to notify Recents that the animation has started Intent intent = new Intent(ACTION_START_ENTER_ANIMATION); intent.setPackage(mContext.getPackageName()); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND); mContext.sendOrderedBroadcastAsUser(intent, UserHandle.CURRENT, null, fallbackReceiver, null, Activity.RESULT_CANCELED, null, null); } } } packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +12 −16 Original line number Diff line number Diff line Loading @@ -141,14 +141,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } else if (action.equals(AlternateRecentsComponent.ACTION_TOGGLE_RECENTS_ACTIVITY)) { // If we are toggling Recents, then first unfilter any filtered stacks first dismissRecentsToFocusedTaskOrHome(true); } else if (action.equals(AlternateRecentsComponent.ACTION_START_ENTER_ANIMATION)) { // Try and start the enter animation (or restart it on configuration changed) ReferenceCountedTrigger t = new ReferenceCountedTrigger(context, null, null, null); mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t)); onEnterAnimationTriggered(); // Notify the fallback receiver that we have successfully got the broadcast // See AlternateRecentsComponent.onAnimationStarted() setResultCode(Activity.RESULT_OK); } } }; Loading Loading @@ -441,7 +433,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView // Try and start the enter animation (or restart it on configuration changed) ReferenceCountedTrigger t = new ReferenceCountedTrigger(this, null, null, null); mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t)); onEnterAnimationTriggered(); // Animate the SystemUI scrim views mScrimViews.startEnterRecentsAnimation(); } @Override Loading Loading @@ -469,7 +462,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView IntentFilter filter = new IntentFilter(); filter.addAction(AlternateRecentsComponent.ACTION_HIDE_RECENTS_ACTIVITY); filter.addAction(AlternateRecentsComponent.ACTION_TOGGLE_RECENTS_ACTIVITY); filter.addAction(AlternateRecentsComponent.ACTION_START_ENTER_ANIMATION); registerReceiver(mServiceBroadcastReceiver, filter); // Register any broadcast receivers for the task loader Loading Loading @@ -511,6 +503,16 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } } @Override public void onEnterAnimationComplete() { // Try and start the enter animation (or restart it on configuration changed) ReferenceCountedTrigger t = new ReferenceCountedTrigger(this, null, null, null); mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t)); // Animate the SystemUI scrim views mScrimViews.startEnterRecentsAnimation(); } @Override public void onTrimMemory(int level) { RecentsTaskLoader loader = RecentsTaskLoader.getInstance(); Loading Loading @@ -592,12 +594,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } } /** Called when the enter recents animation is triggered. */ public void onEnterAnimationTriggered() { // Animate the SystemUI scrim views mScrimViews.startEnterRecentsAnimation(); } /**** RecentsView.RecentsViewCallbacks Implementation ****/ @Override Loading packages/SystemUI/src/com/android/systemui/recents/misc/Utilities.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.recents.misc; import android.animation.Animator; import android.content.Intent; import android.graphics.Color; import android.graphics.Matrix; Loading Loading @@ -188,4 +189,15 @@ public class Utilities { int flags = intent.getFlags(); return (flags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT; } /** * Cancels an animation ensuring that if it has listeners, onCancel and onEnd * are not called. */ public static void cancelAnimationWithoutCallbacks(Animator animator) { if (animator != null) { animator.removeAllListeners(); animator.cancel(); } } } packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class AnimateableViewBounds extends ViewOutlineProvider { mSourceView.invalidateOutline(); updateClipBounds(); if (!mConfig.useHardwareLayers) { mSourceView.mThumbnailView.updateVisibility( mSourceView.mThumbnailView.updateThumbnailVisibility( bottom - mSourceView.getPaddingBottom()); } } Loading Loading
packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ <dimen name="recents_search_bar_space_height">64dp</dimen> <!-- The side padding for the task stack as a percentage of the width. --> <item name="recents_stack_width_padding_percentage" format="float" type="dimen">0.04444</item> <item name="recents_stack_width_padding_percentage" format="float" type="dimen">0.03333</item> <!-- The overscroll percentage allowed on the stack. --> <item name="recents_stack_overscroll_percentage" format="float" type="dimen">0.0875</item> Loading
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +6 −52 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; /** A proxy implementation for the recents component */ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationStartedListener { public class AlternateRecentsComponent { final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome"; final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome"; Loading @@ -63,7 +63,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab"; final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey"; final public static String ACTION_START_ENTER_ANIMATION = "action_start_enter_animation"; final public static String ACTION_TOGGLE_RECENTS_ACTIVITY = "action_toggle_recents_activity"; final public static String ACTION_HIDE_RECENTS_ACTIVITY = "action_hide_recents_activity"; Loading @@ -78,9 +77,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta Context mContext; LayoutInflater mInflater; SystemServicesProxy mSystemServicesProxy; Handler mHandler; boolean mBootCompleted; boolean mStartAnimationTriggered; // Task launching RecentsConfiguration mConfig; Loading @@ -106,7 +103,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta mInflater = LayoutInflater.from(context); mContext = context; mSystemServicesProxy = new SystemServicesProxy(context); mHandler = new Handler(); mTaskStackBounds = new Rect(); } Loading Loading @@ -364,30 +360,27 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta * Creates the activity options for a unknown state->recents transition. */ ActivityOptions getUnknownTransitionActivityOptions() { mStartAnimationTriggered = false; return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_unknown_enter, R.anim.recents_from_unknown_exit, mHandler, this); R.anim.recents_from_unknown_exit); } /** * Creates the activity options for a home->recents transition. */ ActivityOptions getHomeTransitionActivityOptions(boolean fromSearchHome) { mStartAnimationTriggered = false; if (fromSearchHome) { return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_search_launcher_enter, R.anim.recents_from_search_launcher_exit, mHandler, this); R.anim.recents_from_search_launcher_exit); } return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_launcher_enter, R.anim.recents_from_launcher_exit, mHandler, this); R.anim.recents_from_launcher_exit); } /** * Creates the activity options for an app->recents transition. If this method sets the static * screenshot, then we will use that for the transition. * Creates the activity options for an app->recents transition. */ ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) { Loading @@ -411,10 +404,9 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta c.setBitmap(null); } mStartAnimationTriggered = false; return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mStatusBarView, thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(), toTaskRect.height(), this); toTaskRect.height(), null); } // If both the screenshot and thumbnail fails, then just fall back to the default transition Loading Loading @@ -551,42 +543,4 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta sRecentsComponentCallbacks.onVisibilityChanged(visible); } } /**** OnAnimationStartedListener Implementation ****/ @Override public void onAnimationStarted() { // Notify recents to start the enter animation if (!mStartAnimationTriggered) { // There can be a race condition between the start animation callback and // the start of the new activity (where we register the receiver that listens // to this broadcast, so we add our own receiver and if that gets called, then // we know the activity has not yet started and we can retry sending the broadcast. BroadcastReceiver fallbackReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (getResultCode() == Activity.RESULT_OK) { mStartAnimationTriggered = true; return; } // Schedule for the broadcast to be sent again after some time mHandler.postDelayed(new Runnable() { @Override public void run() { onAnimationStarted(); } }, 75); } }; // Send the broadcast to notify Recents that the animation has started Intent intent = new Intent(ACTION_START_ENTER_ANIMATION); intent.setPackage(mContext.getPackageName()); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND); mContext.sendOrderedBroadcastAsUser(intent, UserHandle.CURRENT, null, fallbackReceiver, null, Activity.RESULT_CANCELED, null, null); } } }
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +12 −16 Original line number Diff line number Diff line Loading @@ -141,14 +141,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } else if (action.equals(AlternateRecentsComponent.ACTION_TOGGLE_RECENTS_ACTIVITY)) { // If we are toggling Recents, then first unfilter any filtered stacks first dismissRecentsToFocusedTaskOrHome(true); } else if (action.equals(AlternateRecentsComponent.ACTION_START_ENTER_ANIMATION)) { // Try and start the enter animation (or restart it on configuration changed) ReferenceCountedTrigger t = new ReferenceCountedTrigger(context, null, null, null); mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t)); onEnterAnimationTriggered(); // Notify the fallback receiver that we have successfully got the broadcast // See AlternateRecentsComponent.onAnimationStarted() setResultCode(Activity.RESULT_OK); } } }; Loading Loading @@ -441,7 +433,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView // Try and start the enter animation (or restart it on configuration changed) ReferenceCountedTrigger t = new ReferenceCountedTrigger(this, null, null, null); mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t)); onEnterAnimationTriggered(); // Animate the SystemUI scrim views mScrimViews.startEnterRecentsAnimation(); } @Override Loading Loading @@ -469,7 +462,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView IntentFilter filter = new IntentFilter(); filter.addAction(AlternateRecentsComponent.ACTION_HIDE_RECENTS_ACTIVITY); filter.addAction(AlternateRecentsComponent.ACTION_TOGGLE_RECENTS_ACTIVITY); filter.addAction(AlternateRecentsComponent.ACTION_START_ENTER_ANIMATION); registerReceiver(mServiceBroadcastReceiver, filter); // Register any broadcast receivers for the task loader Loading Loading @@ -511,6 +503,16 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } } @Override public void onEnterAnimationComplete() { // Try and start the enter animation (or restart it on configuration changed) ReferenceCountedTrigger t = new ReferenceCountedTrigger(this, null, null, null); mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t)); // Animate the SystemUI scrim views mScrimViews.startEnterRecentsAnimation(); } @Override public void onTrimMemory(int level) { RecentsTaskLoader loader = RecentsTaskLoader.getInstance(); Loading Loading @@ -592,12 +594,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } } /** Called when the enter recents animation is triggered. */ public void onEnterAnimationTriggered() { // Animate the SystemUI scrim views mScrimViews.startEnterRecentsAnimation(); } /**** RecentsView.RecentsViewCallbacks Implementation ****/ @Override Loading
packages/SystemUI/src/com/android/systemui/recents/misc/Utilities.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.recents.misc; import android.animation.Animator; import android.content.Intent; import android.graphics.Color; import android.graphics.Matrix; Loading Loading @@ -188,4 +189,15 @@ public class Utilities { int flags = intent.getFlags(); return (flags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT; } /** * Cancels an animation ensuring that if it has listeners, onCancel and onEnd * are not called. */ public static void cancelAnimationWithoutCallbacks(Animator animator) { if (animator != null) { animator.removeAllListeners(); animator.cancel(); } } }
packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class AnimateableViewBounds extends ViewOutlineProvider { mSourceView.invalidateOutline(); updateClipBounds(); if (!mConfig.useHardwareLayers) { mSourceView.mThumbnailView.updateVisibility( mSourceView.mThumbnailView.updateThumbnailVisibility( bottom - mSourceView.getPaddingBottom()); } } Loading