ActivityOptionsCompat

public class ActivityOptionsCompat


Helper for accessing features in android.app.ActivityOptions in a backwards compatible fashion.

Summary

Constants

static final String

A long in the extras delivered by requestUsageTimeReport that contains the total time (in ms) the user spent in the app flow.

static final String

A Bundle in the extras delivered by requestUsageTimeReport that contains detailed information about the time spent in each package associated with the app; each key is a package name, whose value is a long containing the time (in ms).

Public constructors

Public methods

@Nullable Rect

Returns the bounds that should be used to launch the activity.

static @NonNull ActivityOptionsCompat

Create a basic ActivityOptions that has no special animation associated with it.

static @NonNull ActivityOptionsCompat
makeClipRevealAnimation(
    @NonNull View source,
    int startX,
    int startY,
    int width,
    int height
)

Create an ActivityOptions specifying an animation where the new activity is revealed from a small originating area of the screen to its final full representation.

static @NonNull ActivityOptionsCompat
makeCustomAnimation(
    @NonNull Context context,
    int enterResId,
    int exitResId
)

Create an ActivityOptions specifying a custom animation to run when the activity is displayed.

static @NonNull ActivityOptionsCompat
makeScaleUpAnimation(
    @NonNull View source,
    int startX,
    int startY,
    int startWidth,
    int startHeight
)

Create an ActivityOptions specifying an animation where the new activity is scaled from a small originating area of the screen to its final full representation.

static @NonNull ActivityOptionsCompat
makeSceneTransitionAnimation(
    @NonNull Activity activity,
    @NonNull View sharedElement,
    @NonNull String sharedElementName
)

Create an ActivityOptions to transition between Activities using cross-Activity scene animations.

static @NonNull ActivityOptionsCompat
makeSceneTransitionAnimation(
    @NonNull Activity activity,
    Pair[] sharedElements
)

Create an ActivityOptions to transition between Activities using cross-Activity scene animations.

static @NonNull ActivityOptionsCompat

If set along with Intent.FLAG_ACTIVITY_NEW_DOCUMENT then the task being launched will not be presented to the user but will instead be only available through