/**@class android.app.ActivityOptions
@extends java.lang.Object
Helper class for building an options Bundle that can be used with
{@link android.content.Context#startActivity(android.content.Intent, android.os.Bundle)
Context.startActivity(Intent, Bundle)} and related methods.
*/
var ActivityOptions = {
/** A long in the extras delivered by {@link #requestUsageTimeReport} that contains
the total time (in ms) the user spent in the app flow.
*/
EXTRA_USAGE_TIME_REPORT : "android.activity.usage_time",
/** A Bundle in the extras delivered by {@link #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).
*/
EXTRA_USAGE_TIME_REPORT_PACKAGES : "android.usage_time_packages",
/** The package name that created the options.
@hide
*/
KEY_PACKAGE_NAME : "android:activity.packageName",
/** The bounds (window size) that the activity should be launched in. Set to null explicitly for
full screen. If the key is not found, previous bounds will be preserved.
NOTE: This value is ignored on devices that don't have
{@link android.content.pm.PackageManager#FEATURE_FREEFORM_WINDOW_MANAGEMENT} or
{@link android.content.pm.PackageManager#FEATURE_PICTURE_IN_PICTURE} enabled.
@hide
*/
KEY_LAUNCH_BOUNDS : "android:activity.launchBounds",
/** Type of animation that arguments specify.
@hide
*/
KEY_ANIM_TYPE : "android:activity.animType",
/** Custom enter animation resource ID.
@hide
*/
KEY_ANIM_ENTER_RES_ID : "android:activity.animEnterRes",
/** Custom exit animation resource ID.
@hide
*/
KEY_ANIM_EXIT_RES_ID : "android:activity.animExitRes",
/** Custom in-place animation resource ID.
@hide
*/
KEY_ANIM_IN_PLACE_RES_ID : "android:activity.animInPlaceRes",
/** Bitmap for thumbnail animation.
@hide
*/
KEY_ANIM_THUMBNAIL : "android:activity.animThumbnail",
/** Start X position of thumbnail animation.
@hide
*/
KEY_ANIM_START_X : "android:activity.animStartX",
/** Start Y position of thumbnail animation.
@hide
*/
KEY_ANIM_START_Y : "android:activity.animStartY",
/** Initial width of the animation.
@hide
*/
KEY_ANIM_WIDTH : "android:activity.animWidth",
/** Initial height of the animation.
@hide
*/
KEY_ANIM_HEIGHT : "android:activity.animHeight",
/** Callback for when animation is started.
@hide
*/
KEY_ANIM_START_LISTENER : "android:activity.animStartListener",
/**@hide */
ANIM_NONE : "0",
/**@hide */
ANIM_CUSTOM : "1",
/**@hide */
ANIM_SCALE_UP : "2",
/**@hide */
ANIM_THUMBNAIL_SCALE_UP : "3",
/**@hide */
ANIM_THUMBNAIL_SCALE_DOWN : "4",
/**@hide */
ANIM_SCENE_TRANSITION : "5",
/**@hide */
ANIM_DEFAULT : "6",
/**@hide */
ANIM_LAUNCH_TASK_BEHIND : "7",
/**@hide */
ANIM_THUMBNAIL_ASPECT_SCALE_UP : "8",
/**@hide */
ANIM_THUMBNAIL_ASPECT_SCALE_DOWN : "9",
/**@hide */
ANIM_CUSTOM_IN_PLACE : "10",
/**@hide */
ANIM_CLIP_REVEAL : "11",
/**@hide */
ANIM_OPEN_CROSS_PROFILE_APPS : "12",
/**@hide */
ANIM_REMOTE_ANIMATION : "13",
/**Create an ActivityOptions specifying a custom animation to run when
the activity is displayed.
@param {Object {Context}} context Who is defining this. This is the application that the
animation resources will be loaded from.
@param {Number} enterResId A resource ID of the animation resource to use for
the incoming activity. Use 0 for no animation.
@param {Number} exitResId A resource ID of the animation resource to use for
the outgoing activity. Use 0 for no animation.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
*/
makeCustomAnimation : function( ) {},
/**Create an ActivityOptions specifying a custom animation to run when
the activity is displayed.
@param {Object {Context}} context Who is defining this. This is the application that the
animation resources will be loaded from.
@param {Number} enterResId A resource ID of the animation resource to use for
the incoming activity. Use 0 for no animation.
@param {Number} exitResId A resource ID of the animation resource to use for
the outgoing activity. Use 0 for no animation.
@param {Object {Handler}} handler If <var>listener</var> is non-null this must be a valid
Handler on which to dispatch the callback; otherwise it should be null.
@param {Object {ActivityOptions.OnAnimationStartedListener}} listener Optional OnAnimationStartedListener to find out when the
requested animation has started running. If for some reason the animation
is not executed, the callback will happen immediately.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
@hide
*/
makeCustomAnimation : function( ) {},
/**Creates an ActivityOptions specifying a custom animation to run in place on an existing
activity.
@param {Object {Context}} context Who is defining this. This is the application that the
animation resources will be loaded from.
@param {Number} animId A resource ID of the animation resource to use for
the incoming activity.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when running an in-place animation.
@hide
*/
makeCustomInPlaceAnimation : function( ) {},
/**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.
<p>If the Intent this is being used with has not set its
{@link android.content.Intent#setSourceBounds Intent.setSourceBounds},
those bounds will be filled in for you based on the initial
bounds passed in here.
@param {Object {View}} source The View that the new activity is animating from. This
defines the coordinate space for <var>startX</var> and <var>startY</var>.
@param {Number} startX The x starting location of the new activity, relative to <var>source</var>.
@param {Number} startY The y starting location of the activity, relative to <var>source</var>.
@param {Number} width The initial width of the new activity.
@param {Number} height The initial height of the new activity.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
*/
makeScaleUpAnimation : function( ) {},
/**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.
@param {Object {View}} source The View that the new activity is animating from. This
defines the coordinate space for <var>startX</var> and <var>startY</var>.
@param {Number} startX The x starting location of the new activity, relative to <var>source</var>.
@param {Number} startY The y starting location of the activity, relative to <var>source</var>.
@param {Number} width The initial width of the new activity.
@param {Number} height The initial height of the new activity.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
*/
makeClipRevealAnimation : function( ) {},
/**Creates an {@link android.app.ActivityOptions} object specifying an animation where the new activity
is started in another user profile by calling {@link android.content.pm.crossprofile.CrossProfileApps#startMainActivity(ComponentName, UserHandle)
}.
@hide
*/
makeOpenCrossProfileAppsAnimation : function( ) {},
/**Create an ActivityOptions specifying an animation where a thumbnail
is scaled from a given position to the new activity window that is
being started.
<p>If the Intent this is being used with has not set its
{@link android.content.Intent#setSourceBounds Intent.setSourceBounds},
those bounds will be filled in for you based on the initial
thumbnail location and size provided here.
@param {Object {View}} source The View that this thumbnail is animating from. This
defines the coordinate space for <var>startX</var> and <var>startY</var>.
@param {Object {Bitmap}} thumbnail The bitmap that will be shown as the initial thumbnail
of the animation.
@param {Number} startX The x starting location of the bitmap, relative to <var>source</var>.
@param {Number} startY The y starting location of the bitmap, relative to <var>source</var>.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
*/
makeThumbnailScaleUpAnimation : function( ) {},
/**Create an ActivityOptions specifying an animation where a list of activity windows and
thumbnails are aspect scaled to/from a new location.
@hide
*/
makeMultiThumbFutureAspectScaleAnimation : function( ) {},
/**Create an ActivityOptions specifying an animation where the new activity
window and a thumbnail is aspect-scaled to a new location.
@param {Object {View}} source The View that this thumbnail is animating to. This
defines the coordinate space for <var>startX</var> and <var>startY</var>.
@param {Object {Bitmap}} thumbnail The bitmap that will be shown as the final thumbnail
of the animation.
@param {Number} startX The x end location of the bitmap, relative to <var>source</var>.
@param {Number} startY The y end location of the bitmap, relative to <var>source</var>.
@param {Number} handler If <var>listener</var> is non-null this must be a valid
Handler on which to dispatch the callback; otherwise it should be null.
@param {Number} listener Optional OnAnimationStartedListener to find out when the
requested animation has started running. If for some reason the animation
is not executed, the callback will happen immediately.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
@hide
*/
makeThumbnailAspectScaleDownAnimation : function( ) {},
/**
@hide
*/
makeThumbnailAspectScaleDownAnimation : function( ) {},
/**Create an ActivityOptions to transition between Activities using cross-Activity scene
animations. This method carries the position of one shared element to the started Activity.
The position of <code>sharedElement</code> will be used as the epicenter for the
exit Transition. The position of the shared element in the launched Activity will be the
epicenter of its entering Transition.
<p>This requires {@link android.view.Window#FEATURE_ACTIVITY_TRANSITIONS} to be
enabled on the calling Activity to cause an exit transition. The same must be in
the called Activity to get an entering transition.</p>
@param {Object {Activity}} activity The Activity whose window contains the shared elements.
@param {Object {View}} sharedElement The View to transition to the started Activity.
@param {String} sharedElementName The shared element name as used in the target Activity. This
must not be null.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
@see android.transition.Transition#setEpicenterCallback(
android.transition.Transition.EpicenterCallback)
*/
makeSceneTransitionAnimation : function( ) {},
/**Create an ActivityOptions to transition between Activities using cross-Activity scene
animations. This method carries the position of multiple shared elements to the started
Activity. The position of the first element in sharedElements
will be used as the epicenter for the exit Transition. The position of the associated
shared element in the launched Activity will be the epicenter of its entering Transition.
<p>This requires {@link android.view.Window#FEATURE_ACTIVITY_TRANSITIONS} to be
enabled on the calling Activity to cause an exit transition. The same must be in
the called Activity to get an entering transition.</p>
@param {Object {Activity}} activity The Activity whose window contains the shared elements.
@param {Object {android.util.Pair[]}} sharedElements The names of the shared elements to transfer to the called
Activity and their associated Views. The Views must each have
a unique shared element name.
@return {Object {android.app.ActivityOptions}} Returns a new ActivityOptions object that you can use to
supply these options as the options Bundle when starting an activity.
@see android.transition.Transition#setEpicenterCallback(
android.transition.Transition.EpicenterCallback)
*/
makeSceneTransitionAnimation : function( ) {},
/**Call this immediately prior to startActivity to begin a shared element transition
from a non-Activity. The window must support Window.FEATURE_ACTIVITY_TRANSITIONS.
The exit transition will start immediately and the shared element transition will
start once the launched Activity's shared element is ready.
<p>
When all transitions have completed and the shared element has been transfered,
the window's decor View will have its visibility set to View.GONE.
@hide
*/
startSharedElementAnimation : function( ) {},
/**This method should be called when the {@link #startSharedElementAnimation(Window, Pair[])}
animation must be stopped and the Views reset. This can happen if there was an error
from startActivity or a springboard activity and the animation should stop and reset.
@hide
*/
stopSharedElementAnimation : function( ) {},
/**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 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.
<p>This behavior is not supported for activities with {@link android.R.styleable#AndroidManifestActivity_launchMode launchMode} values of
<code>singleInstance</code> or <code>singleTask</code>.
*/
makeTaskLaunchBehind : function( ) {},
/**Create a basic ActivityOptions that has no special animation associated with it.
Other options can still be set.
*/
makeBasic : function( ) {},
/**Create an {@link android.app.ActivityOptions} instance that lets the application control the entire
animation using a {@link RemoteAnimationAdapter}.
@hide
*/
makeRemoteAnimation : function( ) {},
/**
@hide
*/
getLaunchTaskBehind : function( ) {},
/**Sets the bounds (window size and position) that the activity should be launched in.
Rect position should be provided in pixels and in screen coordinates.
Set to {@code null} to explicitly launch fullscreen.
<p>
<strong>NOTE:</strong> This value is ignored on devices that don't have
{@link android.content.pm.PackageManager#FEATURE_FREEFORM_WINDOW_MANAGEMENT} or
{@link android.content.pm.PackageManager#FEATURE_PICTURE_IN_PICTURE} enabled.
@param {Object {Rect}} screenSpacePixelRect launch bounds or {@code null} for fullscreen
@return {Object {android.app.ActivityOptions}} {@code this} {@link ActivityOptions} instance
*/
setLaunchBounds : function( ) {},
/**
@hide
*/
getPackageName : function( ) {},
/**Returns the bounds that should be used to launch the activity.
@see #setLaunchBounds(Rect)
@return {Object {android.graphics.Rect}} Bounds used to launch the activity.
*/
getLaunchBounds : function( ) {},
/**
@hide
*/
getAnimationType : function( ) {},
/**
@hide
*/
getCustomEnterResId : function( ) {},
/**
@hide
*/
getCustomExitResId : function( ) {},
/**
@hide
*/
getCustomInPlaceResId : function( ) {},
/**The thumbnail is copied into a hardware bitmap when it is bundled and sent to the system, so
it should always be backed by a GraphicBuffer on the other end.
@hide
*/
getThumbnail : function( ) {},
/**
@hide
*/
getStartX : function( ) {},
/**
@hide
*/
getStartY : function( ) {},
/**
@hide
*/
getWidth : function( ) {},
/**
@hide
*/
getHeight : function( ) {},
/**
@hide
*/
getOnAnimationStartListener : function( ) {},
/**
@hide
*/
getAnimationFinishedListener : function( ) {},
/**
@hide
*/
getExitCoordinatorKey : function( ) {},
/**
@hide
*/
abort : function( ) {},
/**
@hide
*/
isReturning : function( ) {},
/**
@hide
*/
getSharedElementNames : function( ) {},
/**
@hide
*/
getResultReceiver : function( ) {},
/**
@hide
*/
getResultCode : function( ) {},
/**
@hide
*/
getResultData : function( ) {},
/**
@hide
*/
getUsageTimeReport : function( ) {},
/**
@hide
*/
getAnimSpecs : function( ) {},
/**
@hide
*/
getSpecsFuture : function( ) {},
/**
@hide
*/
getRemoteAnimationAdapter : function( ) {},
/**
@hide
*/
setRemoteAnimationAdapter : function( ) {},
/**
@hide
*/
fromBundle : function( ) {},
/**
@hide
*/
abort : function( ) {},
/**Gets whether the activity is to be launched into LockTask mode.
@return {Boolean} {@code true} if the activity is to be launched into LockTask mode.
@see Activity#startLockTask()
@see android.app.admin.DevicePolicyManager#setLockTaskPackages(ComponentName, String[])
*/
getLockTaskMode : function( ) {},
/**Sets whether the activity is to be launched into LockTask mode.
Use this option to start an activity in LockTask mode. Note that only apps permitted by
{@link android.app.admin.DevicePolicyManager} can run in LockTask mode. Therefore, if
{@link android.app.admin.DevicePolicyManager#isLockTaskPermitted(String)} returns
{@code false} for the package of the target activity, a {@link SecurityException} will be
thrown during {@link Context#startActivity(Intent, Bundle)}. This method doesn't affect
activities that are already running — relaunch the activity to run in lock task mode.
Defaults to {@code false} if not set.
@param {Boolean} lockTaskMode {@code true} if the activity is to be launched into LockTask mode.
@return {Object {android.app.ActivityOptions}} {@code this} {@link ActivityOptions} instance.
@see Activity#startLockTask()
@see android.app.admin.DevicePolicyManager#setLockTaskPackages(ComponentName, String[])
*/
setLockTaskEnabled : function( ) {},
/**Gets the id of the display where activity should be launched.
@return {Number} The id of the display where activity should be launched,
{@link android.view.Display#INVALID_DISPLAY} if not set.
@see #setLaunchDisplayId(int)
*/
getLaunchDisplayId : function( ) {},
/**Sets the id of the display where activity should be launched.
An app can launch activities on public displays or private displays that are owned by the app
or where an app already has activities. Otherwise, trying to launch on a private display
or providing an invalid display id will result in an exception.
<p>
Setting launch display id will be ignored on devices that don't have
{@link android.content.pm.PackageManager#FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS}.
@param {Number} launchDisplayId The id of the display where the activity should be launched.
@return {Object {android.app.ActivityOptions}} {@code this} {@link ActivityOptions} instance.
*/
setLaunchDisplayId : function( ) {},
/**
@hide
*/
getLaunchWindowingMode : function( ) {},
/**Sets the windowing mode the activity should launch into. If the input windowing mode is
{@link android.app.WindowConfiguration#WINDOWING_MODE_SPLIT_SCREEN_SECONDARY} and the device
isn't currently in split-screen windowing mode, then the activity will be launched in
{@link android.app.WindowConfiguration#WINDOWING_MODE_FULLSCREEN} windowing mode. For clarity
on this you can use
{@link android.app.WindowConfiguration#WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY}
@hide
*/
setLaunchWindowingMode : function( ) {},
/**
@hide
*/
getLaunchActivityType : function( ) {},
/**
@hide
*/
setLaunchActivityType : function( ) {},
/**Sets the task the activity will be launched in.
@hide
*/
setLaunchTaskId : function( ) {},
/**
@hide
*/
getLaunchTaskId : function( ) {},
/**Specifies intent flags to be applied for any activity started from a PendingIntent.
@hide
*/
setPendingIntentLaunchFlags : function( ) {},
/**
@hide
*/
getPendingIntentLaunchFlags : function( ) {},
/**Set's whether the activity launched with this option should be a task overlay. That is the
activity will always be the top activity of the task. If {@param canResume} is true, then
the task will also not be moved to the front of the stack.
@hide
*/
setTaskOverlay : function( ) {},
/**
@hide
*/
getTaskOverlay : function( ) {},
/**
@hide
*/
canTaskOverlayResume : function( ) {},
/**Sets whether the activity launched should not cause the activity stack it is contained in to
be moved to the front as a part of launching.
@hide
*/
setAvoidMoveToFront : function( ) {},
/**
@return {Boolean} whether the activity launch should prevent moving the associated activity stack to
the front.
@hide
*/
getAvoidMoveToFront : function( ) {},
/**Sets whether the launch of this activity should freeze the recent task list reordering until
the next user interaction or timeout. This flag is only applied when starting an activity
in recents.
@hide
*/
setFreezeRecentTasksReordering : function( ) {},
/**
@return {Boolean} whether the launch of this activity should freeze the recent task list reordering
@hide
*/
freezeRecentTasksReordering : function( ) {},
/**
@hide
*/
getSplitScreenCreateMode : function( ) {},
/**
@hide
*/
setSplitScreenCreateMode : function( ) {},
/**
@hide
*/
setDisallowEnterPictureInPictureWhileLaunching : function( ) {},
/**
@hide
*/
disallowEnterPictureInPictureWhileLaunching : function( ) {},
/**Update the current values in this ActivityOptions from those supplied
in <var>otherOptions</var>. Any values
defined in <var>otherOptions</var> replace those in the base options.
*/
update : function( ) {},
/**Returns the created options as a Bundle, which can be passed to
{@link android.content.Context#startActivity(android.content.Intent, android.os.Bundle)
Context.startActivity(Intent, Bundle)} and related methods.
Note that the returned Bundle is still owned by the ActivityOptions
object; you must not modify it, but can supply it to the startActivity
methods that take an options Bundle.
*/
toBundle : function( ) {},
/**Ask the system track that time the user spends in the app being launched, and
report it back once done. The report will be sent to the given receiver, with
the extras {@link #EXTRA_USAGE_TIME_REPORT} and {@link #EXTRA_USAGE_TIME_REPORT_PACKAGES}
filled in.
<p>The time interval tracked is from launching this activity until the user leaves
that activity's flow. They are considered to stay in the flow as long as
new activities are being launched or returned to from the original flow,
even if this crosses package or task boundaries. For example, if the originator
starts 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, the
time during that entire operation will be included until they finally hit back from
the original image viewer activity.</p>
<p>The user is considered to complete a flow once they switch to another
activity that is not part of the tracked flow. This may happen, for example, by
using the notification shade, launcher, or recents to launch or switch to another
app. Simply going in to these navigation elements does not break the flow (although
the launcher and recents stops time tracking of the session); it is the act of
going somewhere else that completes the tracking.</p>
@param {Object {PendingIntent}} receiver A broadcast receiver that willl receive the report.
*/
requestUsageTimeReport : function( ) {},
/**Return the filtered options only meant to be seen by the target activity itself
@hide
*/
forTargetActivity : function( ) {},
/**Returns the rotation animation set by {@link setRotationAnimationHint} or -1
if unspecified.
@hide
*/
getRotationAnimationHint : function( ) {},
/**Set a rotation animation to be used if launching the activity
triggers an orientation change, or -1 to clear. See
{@link android.view.WindowManager.LayoutParams} for rotation
animation values.
@hide
*/
setRotationAnimationHint : function( ) {},
/**Pop the extra verification bundle for the installer.
This removes the bundle from the ActivityOptions to make sure the installer bundle
is only available once.
@hide
*/
popAppVerificationBundle : function( ) {},
/**Set the {@link Bundle} that is provided to the app installer for additional verification
if the call to {@link Context#startActivity} results in an app being installed.
This Bundle is not provided to any other app besides the installer.
*/
setAppVerificationBundle : function( ) {},
/**
@hide
*/
toString : function( ) {},
};