Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/TransitionUtil.java +40 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,46 @@ public class TransitionUtil { || change.getLastParent().equals(change.getParent())); } /** * Check if all changes in this transition are only ordering changes. If so, we won't animate. */ public static boolean isAllOrderOnly(TransitionInfo info) { for (int i = info.getChanges().size() - 1; i >= 0; --i) { if (!isOrderOnly(info.getChanges().get(i))) return false; } return true; } /** * Look through a transition and see if all non-closing changes are no-animation. If so, no * animation should play. */ public static boolean isAllNoAnimation(TransitionInfo info) { if (isClosingType(info.getType())) { // no-animation is only relevant for launching (open) activities. return false; } boolean hasNoAnimation = false; final int changeSize = info.getChanges().size(); for (int i = changeSize - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); if (isClosingType(change.getMode())) { // ignore closing apps since they are a side-effect of the transition and don't // animate. continue; } if (change.hasFlags(TransitionInfo.FLAG_NO_ANIMATION)) { hasNoAnimation = true; } else if (!isOrderOnly(change) && !change.hasFlags(TransitionInfo.FLAG_IS_OCCLUDED)) { // Ignore the order only or occluded changes since they shouldn't be visible during // animation. For anything else, we need to animate if at-least one relevant // participant *is* animated, return false; } } return hasNoAnimation; } /** * Filter that selects leaf-tasks only. THIS IS ORDER-DEPENDENT! For it to work properly, you * MUST call `test` in the same order that the changes appear in the TransitionInfo. Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -306,7 +306,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { } // Early check if the transition doesn't warrant an animation. if (Transitions.isAllNoAnimation(info) || Transitions.isAllOrderOnly(info) if (TransitionUtil.isAllNoAnimation(info) || TransitionUtil.isAllOrderOnly(info) || (info.getFlags() & WindowManager.TRANSIT_FLAG_INVISIBLE) != 0) { startTransaction.apply(); finishTransaction.apply(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +0 −40 Original line number Diff line number Diff line Loading @@ -672,46 +672,6 @@ public class Transitions implements RemoteCallable<Transitions>, return -1; } /** * Look through a transition and see if all non-closing changes are no-animation. If so, no * animation should play. */ static boolean isAllNoAnimation(TransitionInfo info) { if (isClosingType(info.getType())) { // no-animation is only relevant for launching (open) activities. return false; } boolean hasNoAnimation = false; final int changeSize = info.getChanges().size(); for (int i = changeSize - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); if (isClosingType(change.getMode())) { // ignore closing apps since they are a side-effect of the transition and don't // animate. continue; } if (change.hasFlags(FLAG_NO_ANIMATION)) { hasNoAnimation = true; } else if (!TransitionUtil.isOrderOnly(change) && !change.hasFlags(FLAG_IS_OCCLUDED)) { // Ignore the order only or occluded changes since they shouldn't be visible during // animation. For anything else, we need to animate if at-least one relevant // participant *is* animated, return false; } } return hasNoAnimation; } /** * Check if all changes in this transition are only ordering changes. If so, we won't animate. */ static boolean isAllOrderOnly(TransitionInfo info) { for (int i = info.getChanges().size() - 1; i >= 0; --i) { if (!TransitionUtil.isOrderOnly(info.getChanges().get(i))) return false; } return true; } private Track getOrCreateTrack(int trackId) { while (trackId >= mTracks.size()) { mTracks.add(new Track()); Loading Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/TransitionUtil.java +40 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,46 @@ public class TransitionUtil { || change.getLastParent().equals(change.getParent())); } /** * Check if all changes in this transition are only ordering changes. If so, we won't animate. */ public static boolean isAllOrderOnly(TransitionInfo info) { for (int i = info.getChanges().size() - 1; i >= 0; --i) { if (!isOrderOnly(info.getChanges().get(i))) return false; } return true; } /** * Look through a transition and see if all non-closing changes are no-animation. If so, no * animation should play. */ public static boolean isAllNoAnimation(TransitionInfo info) { if (isClosingType(info.getType())) { // no-animation is only relevant for launching (open) activities. return false; } boolean hasNoAnimation = false; final int changeSize = info.getChanges().size(); for (int i = changeSize - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); if (isClosingType(change.getMode())) { // ignore closing apps since they are a side-effect of the transition and don't // animate. continue; } if (change.hasFlags(TransitionInfo.FLAG_NO_ANIMATION)) { hasNoAnimation = true; } else if (!isOrderOnly(change) && !change.hasFlags(TransitionInfo.FLAG_IS_OCCLUDED)) { // Ignore the order only or occluded changes since they shouldn't be visible during // animation. For anything else, we need to animate if at-least one relevant // participant *is* animated, return false; } } return hasNoAnimation; } /** * Filter that selects leaf-tasks only. THIS IS ORDER-DEPENDENT! For it to work properly, you * MUST call `test` in the same order that the changes appear in the TransitionInfo. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -306,7 +306,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { } // Early check if the transition doesn't warrant an animation. if (Transitions.isAllNoAnimation(info) || Transitions.isAllOrderOnly(info) if (TransitionUtil.isAllNoAnimation(info) || TransitionUtil.isAllOrderOnly(info) || (info.getFlags() & WindowManager.TRANSIT_FLAG_INVISIBLE) != 0) { startTransaction.apply(); finishTransaction.apply(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +0 −40 Original line number Diff line number Diff line Loading @@ -672,46 +672,6 @@ public class Transitions implements RemoteCallable<Transitions>, return -1; } /** * Look through a transition and see if all non-closing changes are no-animation. If so, no * animation should play. */ static boolean isAllNoAnimation(TransitionInfo info) { if (isClosingType(info.getType())) { // no-animation is only relevant for launching (open) activities. return false; } boolean hasNoAnimation = false; final int changeSize = info.getChanges().size(); for (int i = changeSize - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); if (isClosingType(change.getMode())) { // ignore closing apps since they are a side-effect of the transition and don't // animate. continue; } if (change.hasFlags(FLAG_NO_ANIMATION)) { hasNoAnimation = true; } else if (!TransitionUtil.isOrderOnly(change) && !change.hasFlags(FLAG_IS_OCCLUDED)) { // Ignore the order only or occluded changes since they shouldn't be visible during // animation. For anything else, we need to animate if at-least one relevant // participant *is* animated, return false; } } return hasNoAnimation; } /** * Check if all changes in this transition are only ordering changes. If so, we won't animate. */ static boolean isAllOrderOnly(TransitionInfo info) { for (int i = info.getChanges().size() - 1; i >= 0; --i) { if (!TransitionUtil.isOrderOnly(info.getChanges().get(i))) return false; } return true; } private Track getOrCreateTrack(int trackId) { while (trackId >= mTracks.size()) { mTracks.add(new Track()); Loading