import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_TASK_CLOSE;
+import static android.view.WindowManager.TRANSIT_TASK_IN_PLACE;
import static android.view.WindowManager.TRANSIT_TASK_OPEN;
import static android.view.WindowManager.TRANSIT_TASK_OPEN_BEHIND;
import static android.view.WindowManager.TRANSIT_TASK_TO_BACK;
&& isTransitionEqual(TRANSIT_ACTIVITY_CLOSE)) {
// Opening a new activity always supersedes a close for the anim.
setAppTransition(transit, flags);
+ } else if (isTaskTransit(transit) && isActivityTransit(mNextAppTransition)) {
+ // Task animations always supersede activity animations, because if we have both, it
+ // usually means that activity transition were just trampoline activities.
+ setAppTransition(transit, flags);
}
}
boolean prepared = prepare();
|| transit == TRANSIT_KEYGUARD_UNOCCLUDE;
}
+ private static boolean isTaskTransit(int transit) {
+ return transit == TRANSIT_TASK_OPEN
+ || transit == TRANSIT_TASK_CLOSE
+ || transit == TRANSIT_TASK_OPEN_BEHIND
+ || transit == TRANSIT_TASK_TO_BACK
+ || transit == TRANSIT_TASK_TO_FRONT
+ || transit == TRANSIT_TASK_IN_PLACE;
+ }
+
+ private static boolean isActivityTransit(int transit) {
+ return transit == TRANSIT_ACTIVITY_OPEN
+ || transit == TRANSIT_ACTIVITY_CLOSE
+ || transit == TRANSIT_ACTIVITY_RELAUNCH;
+ }
+
/**
* @return whether the transition should show the thumbnail being scaled down.
*/