Package 

Class ActivityOptionsCompat

    • Method Detail

      • makeCustomAnimation

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

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

        Parameters:
        context - Who is defining this.
        enterResId - A resource ID of the animation resource to use for theincoming activity.
        exitResId - A resource ID of the animation resource to use for theoutgoing activity.
      • makeScaleUpAnimation

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

        Create an ActivityOptions specifying an animation where the new activity isscaled from a small originating area of the screen to its final fullrepresentation.

        If the Intent this is being used with has not set its setSourceBounds,those bounds will be filled in for you based on the initial bounds passedin here.
        Parameters:
        source - The View that the new activity is animating from.
        startX - The x starting location of the new activity, relative tosource.
        startY - The y starting location of the activity, relative to source.
        startWidth - The initial width of the new activity.
        startHeight - The initial height of the new activity.
      • makeClipRevealAnimation

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

        Create an ActivityOptions specifying an animation where the newactivity is revealed from a small originating area of the screen toits final full representation.

        Parameters:
        source - The View that the new activity is animating from.
        startX - The x starting location of the new activity, relative to source.
        startY - The y starting location of the activity, relative to source.
        width - The initial width of the new activity.
        height - The initial height of the new activity.
      • makeThumbnailScaleUpAnimation

        @NonNull() static ActivityOptionsCompat makeThumbnailScaleUpAnimation(@NonNull() View source, @NonNull() Bitmap thumbnail, int startX, int startY)

        Create an ActivityOptions specifying an animation where a thumbnail isscaled from a given position to the new activity window that is beingstarted.

        If the Intent this is being used with has not set its setSourceBounds,those bounds will be filled in for you based on the initial thumbnaillocation and size provided here.
        Parameters:
        source - The View that this thumbnail is animating from.
        thumbnail - The bitmap that will be shown as the initial thumbnailof the animation.
        startX - The x starting location of the bitmap, relative to source.
        startY - The y starting location of the bitmap, relative to source.
      • makeSceneTransitionAnimation

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

        Create an ActivityOptions to transition between Activities using cross-Activity sceneanimations. This method carries the position of one shared element to the started Activity.The position of sharedElement will be used as the epicenter for theexit Transition. The position of the shared element in the launched Activity will be theepicenter of its entering Transition.

        This requires FEATURE_CONTENT_TRANSITIONS to beenabled on the calling Activity to cause an exit transition. The same must be inthe called Activity to get an entering transition.

        Parameters:
        activity - The Activity whose window contains the shared elements.
        sharedElement - The View to transition to the started Activity.
        sharedElementName - The shared element name as used in the target Activity.
      • makeSceneTransitionAnimation

        @NonNull() static ActivityOptionsCompat makeSceneTransitionAnimation(@NonNull() Activity activity, Array<Pair<View, String>> sharedElements)

        Create an ActivityOptions to transition between Activities using cross-Activity sceneanimations. This method carries the position of multiple shared elements to the startedActivity. The position of the first element in sharedElementswill be used as the epicenter for the exit Transition. The position of the associatedshared element in the launched Activity will be the epicenter of its entering Transition.

        This requires FEATURE_CONTENT_TRANSITIONS to beenabled on the calling Activity to cause an exit transition. The same must be inthe called Activity to get an entering transition.

        Parameters:
        activity - The Activity whose window contains the shared elements.
        sharedElements - The names of the shared elements to transfer to the calledActivity and their associated Views.
      • makeTaskLaunchBehind

        @NonNull() static ActivityOptionsCompat makeTaskLaunchBehind()

        If set along with Intent.FLAG_ACTIVITY_NEW_DOCUMENT then the task being launched will not bepresented to the user but will instead be only available through the recents task list.In addition, the new task wil be affiliated with the launching activity's task.Affiliated tasks are grouped together in the recents task list.

        This behavior is not supported for activities with launchMode values ofsingleInstance or singleTask.

      • toBundle

        @Nullable() Bundle toBundle()

        Returns the created options as a Bundle, which can be passed to startActivity.Note that the returned Bundle is still owned by the ActivityOptionsobject; you must not modify it, but can supply it to the startActivitymethods that take an options Bundle.

      • update

         void update(@NonNull() ActivityOptionsCompat otherOptions)

        Update the current values in this ActivityOptions from those supplied inotherOptions. Any values defined in otherOptions replace those in thebase options.

      • requestUsageTimeReport

         void requestUsageTimeReport(@NonNull() PendingIntent receiver)

        Ask the the system track that time the user spends in the app being launched, andreport it back once done. The report will be sent to the given receiver, withthe extras EXTRA_USAGE_TIME_REPORT and EXTRA_USAGE_TIME_REPORT_PACKAGES filled in.

        The time interval tracked is from launching this activity until the user leavesthat activity's flow. They are considered to stay in the flow as long asnew activities are being launched or returned to from the original flow,even if this crosses package or task boundaries. For example, if the originatorstarts an activity to view an image, and while there the user selects to share,which launches their email app in a new task, and they complete the share, thetime during that entire operation will be included until they finally hit back fromthe original image viewer activity.

        The user is considered to complete a flow once they switch to anotheractivity that is not part of the tracked flow. This may happen, for example, byusing the notification shade, launcher, or recents to launch or switch to anotherapp. Simply going in to these navigation elements does not break the flow (althoughthe launcher and recents stops time tracking of the session); it is the act ofgoing somewhere else that completes the tracking.

        Parameters:
        receiver - A broadcast receiver that will receive the report.