Moving more callbacks to animated events.
- In preparation for the animation refactoring, this CL just moves the
enter/exit callbacks that route though RecentsView into events that
the task stack can handle directly.
Change-Id: I90f602c5486e1781129225a73dbf97af29477479
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index c95c73b..9e9956e 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -262,39 +262,6 @@
return false;
}
- /** Requests all task stacks to start their enter-recents animation */
- public void startEnterRecentsAnimation(ViewAnimation.TaskViewEnterContext ctx) {
- // We have to increment/decrement the post animation trigger in case there are no children
- // to ensure that it runs
- ctx.postAnimationTrigger.increment();
- if (mTaskStackView != null) {
- mTaskStackView.startEnterRecentsAnimation(ctx);
- }
- ctx.postAnimationTrigger.decrement();
- }
-
- /** Requests all task stacks to start their exit-recents animation */
- public void startExitToHomeAnimation(ViewAnimation.TaskViewExitContext ctx) {
- // We have to increment/decrement the post animation trigger in case there are no children
- // to ensure that it runs
- ctx.postAnimationTrigger.increment();
- if (mTaskStackView != null) {
- mTaskStackView.startExitToHomeAnimation(ctx);
- }
- ctx.postAnimationTrigger.decrement();
-
- // Hide the history button
- int taskViewExitToHomeDuration = getResources().getInteger(
- R.integer.recents_task_exit_to_home_duration);
- hideHistoryButton(taskViewExitToHomeDuration);
-
- // If we are going home, cancel the previous task's window transition
- EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null));
-
- // Notify sof the exit animation
- EventBus.getDefault().send(new DismissRecentsToHomeAnimationStarted());
- }
-
/** Adds the search bar */
public void setSearchBar(RecentsAppWidgetHostView searchBar) {
// Remove the previous search bar if one exists
@@ -496,6 +463,16 @@
event.screenPinningRequested, event.targetTaskBounds, event.targetTaskStack);
}
+ public final void onBusEvent(DismissRecentsToHomeAnimationStarted event) {
+ // Hide the history button
+ int taskViewExitToHomeDuration = getResources().getInteger(
+ R.integer.recents_task_exit_to_home_duration);
+ hideHistoryButton(taskViewExitToHomeDuration);
+
+ // If we are going home, cancel the previous task's window transition
+ EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null));
+ }
+
public final void onBusEvent(DragStartEvent event) {
updateVisibleDockRegions(mTouchHandler.getDockStatesForCurrentOrientation(),
TaskStack.DockState.NONE.viewState.dockAreaAlpha);