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

Commit 2c256a04 authored by George Mount's avatar George Mount
Browse files

Make additional shared elements a version-checked feature.

Bug 22505481

ag/684544 added a feature to allow shared elements that weren't
shared into an Activity to be shared back. However, if you are
targeting an older version of the SDK, you may get an unexpected
shared element back. This change in behavior has been locked
behind a target version check.

Change-Id: I7162e24f3b14fedd6b308e89e9d04ac67660f7d6
parent facfbc52
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -238,8 +239,12 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
            if (decorView != null && decorView.getBackground() == null) {
                getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
            }
            final boolean targetsM = decorView == null || decorView.getContext()
                    .getApplicationInfo().targetSdkVersion >= VERSION_CODES.MNC;
            ArrayList<String> sharedElementNames = targetsM ? mSharedElementNames :
                    mAllSharedElementNames;
            ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(mActivity, this,
                    mSharedElementNames, resultCode, data);
                    sharedElementNames, resultCode, data);
            mActivity.convertToTranslucent(new Activity.TranslucentConversionListener() {
                @Override
                public void onTranslucentConversionComplete(boolean drawComplete) {