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

Commit 7762e8e7 authored by George Mount's avatar George Mount Committed by Android (Google) Code Review
Browse files

Merge "Allow Activities to opt into using Overlay for shared elements." into lmp-dev

parents c90c7d25 b89d5cc2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1445,6 +1445,7 @@ package android {
    field public static final int windowSharedElementExitTransition = 16843834; // 0x101043a
    field public static final int windowSharedElementReenterTransition = 16843954; // 0x10104b2
    field public static final int windowSharedElementReturnTransition = 16843953; // 0x10104b1
    field public static final int windowSharedElementsUseOverlay = 16843964; // 0x10104bc
    field public static final int windowShowAnimation = 16842934; // 0x10100b6
    field public static final int windowShowWallpaper = 16843410; // 0x1010292
    field public static final int windowSoftInputMode = 16843307; // 0x101022b
@@ -35137,6 +35138,7 @@ package android.view {
    method public android.transition.Transition getSharedElementExitTransition();
    method public android.transition.Transition getSharedElementReenterTransition();
    method public android.transition.Transition getSharedElementReturnTransition();
    method public boolean getSharedElementsUseOverlay();
    method public abstract int getStatusBarColor();
    method public long getTransitionBackgroundFadeDuration();
    method public android.transition.TransitionManager getTransitionManager();
@@ -35198,6 +35200,7 @@ package android.view {
    method public void setSharedElementExitTransition(android.transition.Transition);
    method public void setSharedElementReenterTransition(android.transition.Transition);
    method public void setSharedElementReturnTransition(android.transition.Transition);
    method public void setSharedElementsUseOverlay(boolean);
    method public void setSoftInputMode(int);
    method public abstract void setStatusBarColor(int);
    method public abstract void setTitle(java.lang.CharSequence);
+14 −7
Original line number Diff line number Diff line
@@ -665,6 +665,9 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
    }

    protected void moveSharedElementsToOverlay() {
        if (!mWindow.getSharedElementsUseOverlay()) {
            return;
        }
        int numSharedElements = mSharedElements.size();
        ViewGroup decor = getDecor();
        if (decor != null) {
@@ -700,6 +703,17 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
    }

    protected void moveSharedElementsFromOverlay() {
        int numListeners = mGhostViewListeners.size();
        for (int i = 0; i < numListeners; i++) {
            GhostViewListeners listener = mGhostViewListeners.get(i);
            ViewGroup parent = (ViewGroup) listener.getView().getParent();
            parent.getViewTreeObserver().removeOnPreDrawListener(listener);
        }
        mGhostViewListeners.clear();

        if (mWindow == null || !mWindow.getSharedElementsUseOverlay()) {
            return;
        }
        ViewGroup decor = getDecor();
        if (decor != null) {
            ViewGroupOverlay overlay = decor.getOverlay();
@@ -709,13 +723,6 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
                GhostView.removeGhost(sharedElement);
            }
        }
        int numListeners = mGhostViewListeners.size();
        for (int i = 0; i < numListeners; i++) {
            GhostViewListeners listener = mGhostViewListeners.get(i);
            ViewGroup parent = (ViewGroup) listener.getView().getParent();
            parent.getViewTreeObserver().removeOnPreDrawListener(listener);
        }
        mGhostViewListeners.clear();
    }

    protected void setGhostVisibility(int visibility) {
+21 −0
Original line number Diff line number Diff line
@@ -1661,6 +1661,27 @@ public abstract class Window {
     */
    public void setTransitionBackgroundFadeDuration(long fadeDurationMillis) { }

    /**
     * Returns <code>true</code> when shared elements should use an Overlay during
     * shared element transitions or <code>false</code> when they should animate as
     * part of the normal View hierarchy. The default value is true.
     *
     * @return <code>true</code> when shared elements should use an Overlay during
     * shared element transitions or <code>false</code> when they should animate as
     * part of the normal View hierarchy.
     */
    public boolean getSharedElementsUseOverlay() { return true; }

    /**
     * Sets whether or not shared elements should use an Overlay during shared element transitions.
     * The default value is true.
     *
     * @param sharedElementsUseOverlay <code>true</code> indicates that shared elements should
     *                                 be transitioned with an Overlay or <code>false</code>
     *                                 to transition within the normal View hierarchy.
     */
    public void setSharedElementsUseOverlay(boolean sharedElementsUseOverlay) { }

    /**
     * @return the color of the status bar.
     */
+8 −0
Original line number Diff line number Diff line
@@ -517,6 +517,10 @@
             {@link android.view.Window#setAllowExitTransitionOverlap(boolean)}. -->
        <attr name="windowAllowExitTransitionOverlap" format="boolean"/>

        <!-- Indicates whether or not shared elements should use an overlay
             during transitions. The default value is true. -->
        <attr name="windowSharedElementsUseOverlay" format="boolean"/>

        <!-- Internal layout used internally for window decor -->
        <attr name="windowActionBarFullscreenDecorLayout" format="reference" />

@@ -1839,6 +1843,10 @@
             {@link android.view.Window#setAllowExitTransitionOverlap(boolean)}. -->
        <attr name="windowAllowExitTransitionOverlap"/>

        <!-- Indicates whether or not shared elements should use an overlay
             during transitions. The default value is true. -->
        <attr name="windowSharedElementsUseOverlay"/>

        <!-- Flag indicating whether this Window is responsible for drawing the background for the
             system bars. If true and the window is not floating, the system bars are drawn with a
             transparent background and the corresponding areas in this window are filled with the
+1 −0
Original line number Diff line number Diff line
@@ -2275,6 +2275,7 @@
  <public type="attr" name="outlineProvider" />
  <public type="attr" name="ageHint" />
  <public type="attr" name="country" />
  <public type="attr" name="windowSharedElementsUseOverlay" />

  <public-padding type="dimen" name="l_resource_pad" end="0x01050010" />

Loading