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

Commit 3cc716c4 authored by George Mount's avatar George Mount
Browse files

Don't make translucent window opaque during activity transition.

Bug 15535332

Returning transitions will continue to not work until
Bug 14869070 is fixed.

Change-Id: If0128b58eb852b037924ae6dea8e975fedbe5be7
parent 17982084
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -5323,13 +5323,15 @@ public class Activity extends ContextThemeWrapper
     * drawn and it is safe to make this Activity translucent again.
     * @param options activity options delivered to the activity below this one. The options
     * are retrieved using {@link #getActivityOptions}.
     * @return <code>true</code> if Window was opaque and will become translucent or
     * <code>false</code> if window was translucent and no change needed to be made.
     *
     * @see #convertFromTranslucent()
     * @see TranslucentConversionListener
     *
     * @hide
     */
    public void convertToTranslucent(TranslucentConversionListener callback, 
    public boolean convertToTranslucent(TranslucentConversionListener callback,
            ActivityOptions options) {
        boolean drawComplete;
        try {
@@ -5346,6 +5348,7 @@ public class Activity extends ContextThemeWrapper
            // Window is already translucent.
            mTranslucentCallback.onTranslucentConversionComplete(drawComplete);
        }
        return mChangeCanvasToTranslucent;
    }

    /** @hide */
+5 −2
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
    private boolean mIsExitTransitionComplete;
    private boolean mIsReadyForTransition;
    private Bundle mSharedElementsBundle;
    private boolean mWasOpaque;

    public EnterTransitionCoordinator(Activity activity, ResultReceiver resultReceiver,
            ArrayList<String> sharedElementNames, boolean isReturning) {
@@ -191,7 +192,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
    protected void prepareEnter() {
        mActivity.overridePendingTransition(0, 0);
        if (!mIsReturning) {
            mActivity.convertToTranslucent(null, null);
            mWasOpaque = mActivity.convertToTranslucent(null, null);
            Drawable background = getDecor().getBackground();
            if (background != null) {
                getWindow().setBackgroundDrawable(null);
@@ -376,7 +377,9 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {

    private void makeOpaque() {
        if (!mHasStopped && mActivity != null) {
            if (mWasOpaque) {
                mActivity.convertFromTranslucent();
            }
            mActivity = null;
        }
    }