Merge "Skip shared element transition for implicit intent" into udc-dev

This commit is contained in:
Mark Renouf
2023-05-05 17:44:04 +00:00
committed by Android (Google) Code Review

View File

@@ -343,22 +343,24 @@ public class LongScreenshotActivity extends Activity {
} else { } else {
String editorPackage = getString(R.string.config_screenshotEditor); String editorPackage = getString(R.string.config_screenshotEditor);
Intent intent = new Intent(Intent.ACTION_EDIT); Intent intent = new Intent(Intent.ACTION_EDIT);
if (!TextUtils.isEmpty(editorPackage)) {
intent.setComponent(ComponentName.unflattenFromString(editorPackage));
}
intent.setDataAndType(uri, "image/png"); intent.setDataAndType(uri, "image/png");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION
| Intent.FLAG_GRANT_WRITE_URI_PERMISSION); | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
Bundle options = null;
mTransitionView.setImageBitmap(mOutputBitmap); // Skip shared element transition for implicit edit intents
mTransitionView.setVisibility(View.VISIBLE); if (!TextUtils.isEmpty(editorPackage)) {
mTransitionView.setTransitionName( intent.setComponent(ComponentName.unflattenFromString(editorPackage));
ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME); mTransitionView.setImageBitmap(mOutputBitmap);
// TODO: listen for transition completing instead of finishing onStop mTransitionView.setVisibility(View.VISIBLE);
mTransitionStarted = true; mTransitionView.setTransitionName(
startActivity(intent, ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME);
ActivityOptions.makeSceneTransitionAnimation(this, mTransitionView, options = ActivityOptions.makeSceneTransitionAnimation(this, mTransitionView,
ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME).toBundle()); ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME).toBundle();
// TODO: listen for transition completing instead of finishing onStop
mTransitionStarted = true;
}
startActivity(intent, options);
} }
} }