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

Commit 5479dacd authored by Anthony Alridge's avatar Anthony Alridge
Browse files

Open intent with animation for mini-resolver

Uses an animation when the min-resolver opens
an intent (push down and fade out the mini-resolver,
then sliding in the new activity).

Note that this does not work if the new activity is opened
in a new task, due to being unable to override the system
animations for task transitions.

Bug: 271818896
Test: Manual, see bug for before and after video
Test: atest IntentForwarderActivityTest
Change-Id: If64da935621f49e5c5013dd791b85f48c0cfd861
parent be2d9c45
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static com.android.internal.app.ResolverActivity.EXTRA_SELECTED_PROFILE;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.app.Activity;
import android.app.ActivityOptions;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.app.admin.DevicePolicyManager;
@@ -220,7 +221,15 @@ public class IntentForwarderActivity extends Activity {
        findViewById(R.id.use_same_profile_browser).setOnClickListener(v -> finish());

        findViewById(R.id.button_open).setOnClickListener(v -> {
            startActivityAsCaller(launchIntent, targetUserId);
            startActivityAsCaller(
                    launchIntent,
                    ActivityOptions.makeCustomAnimation(
                                    getApplicationContext(),
                                    R.anim.activity_open_enter,
                                    R.anim.push_down_out)
                            .toBundle(),
                    /* ignoreTargetSecurity= */ false,
                    targetUserId);
            finish();
        });
    }