Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57f76f1c authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Animate the dock divider appearance/disappearance.

We want to animate the dock divider appearance only after the entrance
animation of the docked activity finishes, so these two don't clash. For
disappearance they will animate together.

Bug: 24913915
Change-Id: Ibe5c3960f21fcc5e64039b158605fa09017c5c34
parent 3b2872a8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1450,6 +1450,8 @@
  <java-symbol type="anim" name="dock_left_exit" />
  <java-symbol type="anim" name="dock_right_enter" />
  <java-symbol type="anim" name="dock_right_exit" />
  <java-symbol type="anim" name="fade_in" />
  <java-symbol type="anim" name="fade_out" />
  <java-symbol type="anim" name="voice_activity_close_exit" />
  <java-symbol type="anim" name="voice_activity_close_enter" />
  <java-symbol type="anim" name="voice_activity_open_exit" />
+6 −0
Original line number Diff line number Diff line
@@ -2532,6 +2532,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    return R.anim.dock_right_enter;
                }
            }
        } else if (win.getAttrs().type == TYPE_DOCK_DIVIDER) {
            if (transit == TRANSIT_ENTER) {
                return R.anim.fade_in;
            } else if (transit == TRANSIT_EXIT) {
                return R.anim.fade_out;
            }
        }

        if (transit == TRANSIT_PREVIEW_DONE) {
+5 −5
Original line number Diff line number Diff line
@@ -274,11 +274,11 @@ class AppWindowToken extends WindowToken {
            // If we're animating with a saved surface, we're already visible.
            // Return true so that the alpha doesn't get cleared.
            if (!win.mAppFreezing
                    && (win.mViewVisibility == View.VISIBLE
                    || mAnimatingWithSavedSurface
                    || (win.mWinAnimator.isAnimating() &&
                            !service.mAppTransition.isTransitionSet()))
                    && !win.mDestroying && win.isDrawnLw()) {
                    && (win.mViewVisibility == View.VISIBLE || mAnimatingWithSavedSurface
                            || (win.mWinAnimator.isAnimating()
                                    && !service.mAppTransition.isTransitionSet()))
                    && !win.mDestroying
                    && win.isDrawnLw()) {
                return true;
            }
        }
+3 −3
Original line number Diff line number Diff line
@@ -122,10 +122,10 @@ public class DockedStackDividerController implements View.OnTouchListener, DimLa
        if (forceUpdate && mView != null) {
            removeDivider();
        }
        TaskStack stack = mDisplayContent.getDockedStackLocked();
        if (stack != null && mView == null) {
        TaskStack stack = mDisplayContent.mService.mStackIdToStack.get(DOCKED_STACK_ID);
        if (stack != null && stack.hasWindowWithFinalVisibility() && mView == null) {
            addDivider(configuration);
        } else if (stack == null && mView != null) {
        } else if ((stack == null || !stack.isVisibleLocked()) && mView != null) {
            removeDivider();
        }
    }
+22 −0
Original line number Diff line number Diff line
@@ -700,4 +700,26 @@ public class TaskStack implements DimLayer.DimLayerUser {
        }
        return false;
    }

    /**
     * Returns true if this stack has a window that is fully visible, doesn't perform an entry
     * animation and is just positioned where it's supposed to be.
     */
    boolean hasWindowWithFinalVisibility() {
        for (int i = mTasks.size() - 1; i >= 0; i--) {
            Task task = mTasks.get(i);
            for (int j = task.mAppTokens.size() - 1; j >= 0; j--) {
                final AppWindowToken token = task.mAppTokens.get(j);
                if (token.mAppAnimator.animating || token.mWillReplaceWindow) {
                    continue;
                }
                WindowState win = token.findMainWindow();
                if (win != null && !win.mWinAnimator.mEnterAnimationPending
                        && !win.mWinAnimator.mEnteringAnimation) {
                    return true;
                }
            }
        }
        return false;
    }
}
Loading