Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentAnimationSpec.java +29 −8 Original line number Diff line number Diff line Loading @@ -86,13 +86,23 @@ class TaskFragmentAnimationSpec { /** Animation for target that is opening in a change transition. */ @NonNull Animation createChangeBoundsOpenAnimation(@NonNull RemoteAnimationTarget target) { final Rect bounds = target.localBounds; // The target will be animated in from left or right depends on its position. final int startLeft = bounds.left == 0 ? -bounds.width() : bounds.width(); final Rect parentBounds = target.taskInfo.configuration.windowConfiguration.getBounds(); final Rect bounds = target.screenSpaceBounds; final int startLeft; final int startTop; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated in from left or right depending on its position. startTop = 0; startLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated in from top or bottom depending on its position. startTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); startLeft = 0; } // The position should be 0-based as we will post translate in // TaskFragmentAnimationAdapter#onAnimationUpdate final Animation animation = new TranslateAnimation(startLeft, 0, 0, 0); final Animation animation = new TranslateAnimation(startLeft, 0, startTop, 0); animation.setInterpolator(mFastOutExtraSlowInInterpolator); animation.setDuration(CHANGE_ANIMATION_DURATION); animation.initialize(bounds.width(), bounds.height(), bounds.width(), bounds.height()); Loading @@ -103,13 +113,24 @@ class TaskFragmentAnimationSpec { /** Animation for target that is closing in a change transition. */ @NonNull Animation createChangeBoundsCloseAnimation(@NonNull RemoteAnimationTarget target) { final Rect bounds = target.localBounds; // The target will be animated out to left or right depends on its position. final int endLeft = bounds.left == 0 ? -bounds.width() : bounds.width(); final Rect parentBounds = target.taskInfo.configuration.windowConfiguration.getBounds(); // TODO(b/258126915): we want to keep track of the closing start bounds final Rect bounds = target.screenSpaceBounds; final int endTop; final int endLeft; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated out to left or right depending on its position. endTop = 0; endLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated out to top or bottom depending on its position. endTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); endLeft = 0; } // The position should be 0-based as we will post translate in // TaskFragmentAnimationAdapter#onAnimationUpdate final Animation animation = new TranslateAnimation(0, endLeft, 0, 0); final Animation animation = new TranslateAnimation(0, endLeft, 0, endTop); animation.setInterpolator(mFastOutExtraSlowInInterpolator); animation.setDuration(CHANGE_ANIMATION_DURATION); animation.initialize(bounds.width(), bounds.height(), bounds.width(), bounds.height()); Loading libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java +4 −4 Original line number Diff line number Diff line Loading @@ -86,11 +86,11 @@ class ActivityEmbeddingAnimationSpec { final int startLeft; final int startTop; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated in from left or right depends on its position. // The window will be animated in from left or right depending on its position. startTop = 0; startLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated in from top or bottom depends on its position. // The window will be animated in from top or bottom depending on its position. startTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); startLeft = 0; } Loading @@ -114,11 +114,11 @@ class ActivityEmbeddingAnimationSpec { final int endTop; final int endLeft; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated out to left or right depends on its position. // The window will be animated out to left or right depending on its position. endTop = 0; endLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated out to top or bottom depends on its position. // The window will be animated out to top or bottom depending on its position. endTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); endLeft = 0; } Loading Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentAnimationSpec.java +29 −8 Original line number Diff line number Diff line Loading @@ -86,13 +86,23 @@ class TaskFragmentAnimationSpec { /** Animation for target that is opening in a change transition. */ @NonNull Animation createChangeBoundsOpenAnimation(@NonNull RemoteAnimationTarget target) { final Rect bounds = target.localBounds; // The target will be animated in from left or right depends on its position. final int startLeft = bounds.left == 0 ? -bounds.width() : bounds.width(); final Rect parentBounds = target.taskInfo.configuration.windowConfiguration.getBounds(); final Rect bounds = target.screenSpaceBounds; final int startLeft; final int startTop; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated in from left or right depending on its position. startTop = 0; startLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated in from top or bottom depending on its position. startTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); startLeft = 0; } // The position should be 0-based as we will post translate in // TaskFragmentAnimationAdapter#onAnimationUpdate final Animation animation = new TranslateAnimation(startLeft, 0, 0, 0); final Animation animation = new TranslateAnimation(startLeft, 0, startTop, 0); animation.setInterpolator(mFastOutExtraSlowInInterpolator); animation.setDuration(CHANGE_ANIMATION_DURATION); animation.initialize(bounds.width(), bounds.height(), bounds.width(), bounds.height()); Loading @@ -103,13 +113,24 @@ class TaskFragmentAnimationSpec { /** Animation for target that is closing in a change transition. */ @NonNull Animation createChangeBoundsCloseAnimation(@NonNull RemoteAnimationTarget target) { final Rect bounds = target.localBounds; // The target will be animated out to left or right depends on its position. final int endLeft = bounds.left == 0 ? -bounds.width() : bounds.width(); final Rect parentBounds = target.taskInfo.configuration.windowConfiguration.getBounds(); // TODO(b/258126915): we want to keep track of the closing start bounds final Rect bounds = target.screenSpaceBounds; final int endTop; final int endLeft; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated out to left or right depending on its position. endTop = 0; endLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated out to top or bottom depending on its position. endTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); endLeft = 0; } // The position should be 0-based as we will post translate in // TaskFragmentAnimationAdapter#onAnimationUpdate final Animation animation = new TranslateAnimation(0, endLeft, 0, 0); final Animation animation = new TranslateAnimation(0, endLeft, 0, endTop); animation.setInterpolator(mFastOutExtraSlowInInterpolator); animation.setDuration(CHANGE_ANIMATION_DURATION); animation.initialize(bounds.width(), bounds.height(), bounds.width(), bounds.height()); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java +4 −4 Original line number Diff line number Diff line Loading @@ -86,11 +86,11 @@ class ActivityEmbeddingAnimationSpec { final int startLeft; final int startTop; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated in from left or right depends on its position. // The window will be animated in from left or right depending on its position. startTop = 0; startLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated in from top or bottom depends on its position. // The window will be animated in from top or bottom depending on its position. startTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); startLeft = 0; } Loading @@ -114,11 +114,11 @@ class ActivityEmbeddingAnimationSpec { final int endTop; final int endLeft; if (parentBounds.top == bounds.top && parentBounds.bottom == bounds.bottom) { // The window will be animated out to left or right depends on its position. // The window will be animated out to left or right depending on its position. endTop = 0; endLeft = parentBounds.left == bounds.left ? -bounds.width() : bounds.width(); } else { // The window will be animated out to top or bottom depends on its position. // The window will be animated out to top or bottom depending on its position. endTop = parentBounds.top == bounds.top ? -bounds.height() : bounds.height(); endLeft = 0; } Loading