diff options
| author | 2023-03-01 21:28:38 -0800 | |
|---|---|---|
| committer | 2023-03-01 21:31:07 -0800 | |
| commit | 05ba3a265af1b5763899d543f66d033fbd3cbeb7 (patch) | |
| tree | 846db70bf40eb8f3cd802aa5f81a7462ff871431 /java/src | |
| parent | 37364423c143a737c37a10de6ede2f25fd476ad1 (diff) | |
Add animation to custom actions
Animate custom actions in the same way as targets selection i.e.
slide-out to the left / slide-in from the right.
Bug: 271366532
Test: manual testing
Change-Id: I2fbff047b8a06cbdd890b56db45ba1efce3e3f95
Diffstat (limited to 'java/src')
| -rw-r--r-- | java/src/com/android/intentresolver/ChooserActionFactory.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/java/src/com/android/intentresolver/ChooserActionFactory.java b/java/src/com/android/intentresolver/ChooserActionFactory.java index 566b2546..14d59720 100644 --- a/java/src/com/android/intentresolver/ChooserActionFactory.java +++ b/java/src/com/android/intentresolver/ChooserActionFactory.java @@ -18,6 +18,7 @@ package com.android.intentresolver; import android.annotation.Nullable; import android.app.Activity; +import android.app.ActivityOptions; import android.app.PendingIntent; import android.content.ClipData; import android.content.ClipboardManager; @@ -490,7 +491,18 @@ public final class ChooserActionFactory implements ChooserContentPreviewUi.Actio icon, () -> { try { - action.getAction().send(); + action.getAction().send( + null, + 0, + null, + null, + null, + null, + ActivityOptions.makeCustomAnimation( + context, + R.anim.slide_in_right, + R.anim.slide_out_left) + .toBundle()); } catch (PendingIntent.CanceledException e) { Log.d(TAG, "Custom action, " + action.getLabel() + ", has been cancelled"); } |