Merge "Fix shared transitions from work profile" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7cacb22ac4
@@ -767,7 +767,9 @@ public class ScreenshotView extends FrameLayout implements
|
||||
mShareChip.setOnClickListener(v -> {
|
||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SHARE_TAPPED, 0, mPackageName);
|
||||
if (mFlags.isEnabled(Flags.SCREENSHOT_WORK_PROFILE_POLICY)) {
|
||||
mActionExecutor.launchIntentAsync(ActionIntentCreator.INSTANCE.createShareIntent(
|
||||
prepareSharedTransition();
|
||||
mActionExecutor.launchIntentAsync(
|
||||
ActionIntentCreator.INSTANCE.createShareIntent(
|
||||
imageData.uri, imageData.subject),
|
||||
imageData.shareTransition.get().bundle,
|
||||
imageData.owner.getIdentifier(), false);
|
||||
@@ -778,6 +780,7 @@ public class ScreenshotView extends FrameLayout implements
|
||||
mEditChip.setOnClickListener(v -> {
|
||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_EDIT_TAPPED, 0, mPackageName);
|
||||
if (mFlags.isEnabled(Flags.SCREENSHOT_WORK_PROFILE_POLICY)) {
|
||||
prepareSharedTransition();
|
||||
mActionExecutor.launchIntentAsync(
|
||||
ActionIntentCreator.INSTANCE.createEditIntent(imageData.uri, mContext),
|
||||
imageData.editTransition.get().bundle,
|
||||
@@ -789,6 +792,7 @@ public class ScreenshotView extends FrameLayout implements
|
||||
mScreenshotPreview.setOnClickListener(v -> {
|
||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_PREVIEW_TAPPED, 0, mPackageName);
|
||||
if (mFlags.isEnabled(Flags.SCREENSHOT_WORK_PROFILE_POLICY)) {
|
||||
prepareSharedTransition();
|
||||
mActionExecutor.launchIntentAsync(
|
||||
ActionIntentCreator.INSTANCE.createEditIntent(imageData.uri, mContext),
|
||||
imageData.editTransition.get().bundle,
|
||||
@@ -1064,6 +1068,12 @@ public class ScreenshotView extends FrameLayout implements
|
||||
}
|
||||
}
|
||||
|
||||
private void prepareSharedTransition() {
|
||||
mPendingSharedTransition = true;
|
||||
// fade out non-preview UI
|
||||
createScreenshotFadeDismissAnimation().start();
|
||||
}
|
||||
|
||||
ValueAnimator createScreenshotFadeDismissAnimation() {
|
||||
ValueAnimator alphaAnim = ValueAnimator.ofFloat(0, 1);
|
||||
alphaAnim.addUpdateListener(animation -> {
|
||||
|
||||
Reference in New Issue
Block a user