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
This commit is contained in:
Anthony Alridge
2023-05-12 13:11:46 +00:00
parent be2d9c4580
commit 5479dacd8c

View File

@@ -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();
});
}