java.lang.Object | |
↳ | android.view.Window |
Abstract base class for a top-level window look and behavior policy. An instance of this class should be used as the top-level view added to the window manager. It provides standard UI policies such as a background, title area, default key processing, etc.
The only existing implementation of this abstract class is android.policy.PhoneWindow, which you should instantiate when needing a Window. Eventually that class will be refactored and a factory method added for creating Window instances without knowing about a particular implementation.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Window.Callback | API from a Window back to its caller. |
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
android:windowAllowEnterTransitionOverlap | setAllowEnterTransitionOverlap(boolean) | Flag indicating whether this Window's transition should overlap with the exiting transition of the calling Activity. | |||||||||
android:windowAllowReturnTransitionOverlap | setAllowReturnTransitionOverlap(boolean) | Flag indicating whether this Window's transition should overlap with the exiting transition of the called Activity when the called Activity finishes. | |||||||||
android:windowContentTransitionManager | setTransitionManager(TransitionManager) | Reference to a TransitionManager XML resource defining the desired transitions between different window content. | |||||||||
android:windowEnterTransition | setEnterTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used to move Views into the initial Window's content Scene. | |||||||||
android:windowExitTransition | setExitTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used to move Views out of the Window's content Scene when launching a new Activity. | |||||||||
android:windowReenterTransition | setReenterTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used to move Views in to the scene when returning from a previously-started Activity. | |||||||||
android:windowReturnTransition | setReturnTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used to move Views out of the scene when the Window is preparing to close. | |||||||||
android:windowSharedElementEnterTransition | setSharedElementEnterTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used to move shared elements transferred into the Window's initial content Scene. | |||||||||
android:windowSharedElementExitTransition | setSharedElementExitTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used when starting a new Activity to move shared elements prior to transferring to the called Activity. | |||||||||
android:windowSharedElementReenterTransition | setSharedElementReenterTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used for shared elements transferred back to a calling Activity. | |||||||||
android:windowSharedElementReturnTransition | setSharedElementReturnTransition(Transition) | Reference to a Transition XML resource defining the desired Transition used to move shared elements transferred back to a calling Activity. | |||||||||
android:windowSharedElementsUseOverlay | setSharedElementsUseOverlay(boolean) | Indicates whether or not shared elements should use an overlay during transitions. | |||||||||
android:windowTransitionBackgroundFadeDuration | setTransitionBackgroundFadeDuration(long) | The duration, in milliseconds, of the window background fade duration when transitioning into or away from an Activity when called with an Activity Transition. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_FEATURES |
This constant is deprecated.
use getDefaultFeatures(android.content.Context) instead.
|
|||||||||
int | FEATURE_ACTION_BAR | Flag for enabling the Action Bar. | |||||||||
int | FEATURE_ACTION_BAR_OVERLAY | Flag for requesting an Action Bar that overlays window content. | |||||||||
int | FEATURE_ACTION_MODE_OVERLAY | Flag for specifying the behavior of action modes when an Action Bar is not present. | |||||||||
int | FEATURE_ACTIVITY_TRANSITIONS |
Enables Activities to run Activity Transitions either through sending or receiving
ActivityOptions bundle created with
makeSceneTransitionAnimation(android.app.Activity, android.util.Pair[]) or makeSceneTransitionAnimation(android.app.Activity, View, String) .
|
|||||||||
int | FEATURE_CONTENT_TRANSITIONS | Flag for requesting that window content changes should be animated using a TransitionManager. | |||||||||
int | FEATURE_CONTEXT_MENU | Flag for the context menu. | |||||||||
int | FEATURE_CUSTOM_TITLE | Flag for custom title. | |||||||||
int | FEATURE_INDETERMINATE_PROGRESS | Flag for indeterminate progress | |||||||||
int | FEATURE_LEFT_ICON | Flag for having an icon on the left side of the title bar | |||||||||
int | FEATURE_NO_TITLE | Flag for the "no title" feature, turning off the title at the top of the screen. | |||||||||
int | FEATURE_OPTIONS_PANEL | Flag for the "options panel" feature. | |||||||||
int | FEATURE_PROGRESS | Flag for the progress indicator feature | |||||||||
int | FEATURE_RIGHT_ICON | Flag for having an icon on the right side of the title bar | |||||||||
int | FEATURE_SWIPE_TO_DISMISS | Flag for requesting a decoration-free window that is dismissed by swiping from the left. | |||||||||
int | ID_ANDROID_CONTENT | The ID that the main layout in the XML layout file should have. | |||||||||
String | NAVIGATION_BAR_BACKGROUND_TRANSITION_NAME | The transitionName for the navigation bar background View when a custom background is used. | |||||||||
int | PROGRESS_END | Ending value for the (primary) progress | |||||||||
int | PROGRESS_INDETERMINATE_OFF | Flag for setting the progress bar's indeterminate mode off | |||||||||
int | PROGRESS_INDETERMINATE_ON | Flag for setting the progress bar's indeterminate mode on | |||||||||
int | PROGRESS_SECONDARY_END | Highest possible value for the secondary progress | |||||||||
int | PROGRESS_SECONDARY_START | Lowest possible value for the secondary progress | |||||||||
int | PROGRESS_START | Starting value for the (primary) progress | |||||||||
int | PROGRESS_VISIBILITY_OFF | Flag for setting the progress bar's visibility to GONE | |||||||||
int | PROGRESS_VISIBILITY_ON | Flag for setting the progress bar's visibility to VISIBLE | |||||||||
String | STATUS_BAR_BACKGROUND_TRANSITION_NAME | The transitionName for the status bar background View when a custom background is used. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Variation on
setContentView(View, android.view.ViewGroup.LayoutParams)
to add an additional content view to the screen.
| |||||||||||
Convenience function to set the flag bits as specified in flags, as
per
setFlags(int, int) .
| |||||||||||
Convenience function to clear the flag bits as specified in flags, as
per
setFlags(int, int) .
| |||||||||||
Finds a view that was identified by the id attribute from the XML that
was processed in
onCreate(Bundle) .
| |||||||||||
Returns how the transition set in
setEnterTransition(android.transition.Transition) overlaps with the exit
transition of the calling Activity.
| |||||||||||
Returns how the transition set in
setExitTransition(android.transition.Transition) overlaps with the exit
transition of the called Activity when reentering after if finishes.
| |||||||||||
Retrieve the current window attributes associated with this panel.
| |||||||||||
Return the current Callback interface for this window.
| |||||||||||
Return the container for this Window.
| |||||||||||
Retrieve the
Scene representing this window's current content.
| |||||||||||
Return the Context this window policy is running in, for retrieving
resources and other information.
| |||||||||||
Return the view in this Window that currently has focus, or null if
there are none.
| |||||||||||
Retrieve the top-level window decor view (containing the standard
window frame/decorations and the client's content inside of that), which
can be added as a window to the window manager.
| |||||||||||
Return the feature bits set by default on a window.
| |||||||||||
Returns the transition used to move Views into the initial scene.
| |||||||||||
Returns the Transition that will be used to move Views out of the scene when starting a
new Activity.
| |||||||||||
Quick access to the
LayoutInflater instance that this Window
retrieved from its Context.
| |||||||||||
Gets the
MediaController that was previously set.
| |||||||||||
Returns the Transition that will be used to move Views in to the scene when returning from
a previously-started Activity.
| |||||||||||
Returns he Transition that will be used to move Views out of the scene when the Window is
preparing to close, for example after a call to
finishAfterTransition() .
| |||||||||||
Returns the Transition that will be used for shared elements transferred into the content
Scene.
| |||||||||||
Returns the Transition to use for shared elements in the launching Window prior
to transferring to the launched Activity's Window.
| |||||||||||
Returns the Transition that will be used for shared elements reentering from a started
Activity after it has returned the shared element to it start location.
| |||||||||||
Returns the Transition that will be used for shared elements transferred back to a
calling Activity.
| |||||||||||
Returns
true when shared elements should use an Overlay during
shared element transitions or false when they should animate as
part of the normal View hierarchy.
| |||||||||||
Returns the duration, in milliseconds, of the window background fade
when transitioning into or away from an Activity when called with an Activity Transition.
| |||||||||||
Retrieve the
TransitionManager responsible for for default transitions
in this window.
| |||||||||||
Return the window manager allowing this Window to display its own
windows.
| |||||||||||
Return the
Window attributes from this
window's theme.
| |||||||||||
Query for the availability of a certain feature.
| |||||||||||
Inject an event to window locally.
| |||||||||||
Return whether this window is being displayed with a floating style
(based on the
windowIsFloating attribute in
the style/theme).
| |||||||||||
Is a keypress one of the defined shortcut keys for this window.
| |||||||||||
Should be called when the configuration is changed.
| |||||||||||
Retrieve the current decor view, but only if it has already been created;
otherwise returns null.
| |||||||||||
Enable extended screen features.
| |||||||||||
Controls how the transition set in
setEnterTransition(android.transition.Transition) overlaps with the exit
transition of the calling Activity.
| |||||||||||
Controls how the transition set in
setExitTransition(android.transition.Transition) overlaps with the exit
transition of the called Activity when reentering after if finishes.
| |||||||||||
Specify custom window attributes.
| |||||||||||
Change the background of this window to a custom Drawable.
| |||||||||||
Change the background of this window to a Drawable resource.
| |||||||||||
Set the Callback interface for this window, used to intercept key
events and other dynamic operations in the window.
| |||||||||||
Sets whether window content should be clipped to the outline of the
window background.
| |||||||||||
Set the container for this window.
| |||||||||||
Convenience for
setContentView(View, android.view.ViewGroup.LayoutParams)
to set the screen content from a layout resource.
| |||||||||||
Convenience for
setContentView(View, android.view.ViewGroup.LayoutParams)
set the screen content to an explicit view.
| |||||||||||
Set the screen content to an explicit view.
| |||||||||||
Set the amount of dim behind the window when using
FLAG_DIM_BEHIND .
| |||||||||||
Sets the window elevation.
| |||||||||||
Sets the Transition that will be used to move Views into the initial scene.
| |||||||||||
Sets the Transition that will be used to move Views out of the scene when starting a
new Activity.
| |||||||||||
Set an explicit Drawable value for feature of this window.
| |||||||||||
Set a custom alpha value for the given drawable feature, controlling how
much the background is visible through it.
| |||||||||||
Set the value for a drawable feature of this window, from a resource
identifier.
| |||||||||||
Set the value for a drawable feature of this window, from a URI.
| |||||||||||
Set the integer value for a feature.
| |||||||||||
Set the flags of the window, as per the
WindowManager.LayoutParams
flags.
| |||||||||||
Set the format of window, as per the PixelFormat types.
| |||||||||||
Set the gravity of the window, as per the Gravity constants.
| |||||||||||
Set the primary icon for this window.
| |||||||||||
Set the width and height layout parameters of the window.
| |||||||||||
Set focus locally.
| |||||||||||
Set the logo for this window.
| |||||||||||
Sets a
MediaController to send media keys and volume changes to.
| |||||||||||
Sets the color of the navigation bar to .
| |||||||||||
Sets the Transition that will be used to move Views in to the scene when returning from
a previously-started Activity.
| |||||||||||
Sets the Transition that will be used to move Views out of the scene when the Window is
preparing to close, for example after a call to
finishAfterTransition() .
| |||||||||||
Sets the Transition that will be used for shared elements transferred into the content
Scene.
| |||||||||||
Sets the Transition that will be used for shared elements after starting a new Activity
before the shared elements are transferred to the called Activity.
| |||||||||||
Sets the Transition that will be used for shared elements reentering from a started
Activity after it has returned the shared element to it start location.
| |||||||||||
Sets the Transition that will be used for shared elements transferred back to a
calling Activity.
| |||||||||||
Sets whether or not shared elements should use an Overlay during shared element transitions.
| |||||||||||
Specify an explicit soft input mode to use for the window, as per
WindowManager.LayoutParams.softInputMode .
| |||||||||||
Sets the color of the status bar to .
| |||||||||||
Sets the duration, in milliseconds, of the window background fade
when transitioning into or away from an Activity when called with an Activity Transition.
| |||||||||||
Set the
TransitionManager to use for default transitions in this window.
| |||||||||||
Set the type of the window, as per the WindowManager.LayoutParams
types.
| |||||||||||
Set extra options that will influence the UI for this window.
| |||||||||||
Set extra options that will influence the UI for this window.
| |||||||||||
Specify custom animations to use for the window, as per
WindowManager.LayoutParams.windowAnimations .
| |||||||||||
Set the window manager for use by this Window to, for example,
display panels.
| |||||||||||
Set the window manager for use by this Window to, for example,
display panels.
| |||||||||||
Used by custom windows, such as Dialog, to pass the generic motion event
further down the view hierarchy.
| |||||||||||
Used by custom windows, such as Dialog, to pass the key press event
further down the view hierarchy.
| |||||||||||
Used by custom windows, such as Dialog, to pass the key shortcut press event
further down the view hierarchy.
| |||||||||||
Used by custom windows, such as Dialog, to pass the touch screen event
further down the view hierarchy.
| |||||||||||
Used by custom windows, such as Dialog, to pass the trackball event
further down the view hierarchy.
| |||||||||||
Take ownership of this window's InputQueue.
| |||||||||||
Request that key events come to this activity.
| |||||||||||
Take ownership of this window's surface.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the feature bits that are enabled.
| |||||||||||
Return the window flags that have been explicitly set by the client,
so will not be modified by
getDecorView() .
| |||||||||||
Return the feature bits that are being implemented by this Window.
| |||||||||||
Has the app specified their own soft input mode?
| |||||||||||
Set the default format of window, as per the PixelFormat types.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Flag indicating whether this Window's transition should overlap with
the exiting transition of the calling Activity. Corresponds to
setAllowEnterTransitionOverlap(boolean)
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol windowAllowEnterTransitionOverlap
.
Flag indicating whether this Window's transition should overlap with
the exiting transition of the called Activity when the called Activity
finishes. Corresponds to
setAllowReturnTransitionOverlap(boolean)
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol windowAllowReturnTransitionOverlap
.
Reference to a TransitionManager XML resource defining the desired transitions between different window content.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowContentTransitionManager
.
Reference to a Transition XML resource defining the desired Transition
used to move Views into the initial Window's content Scene. Corresponds to
setEnterTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowEnterTransition
.
Reference to a Transition XML resource defining the desired Transition
used to move Views out of the Window's content Scene when launching a new Activity.
Corresponds to
setExitTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowExitTransition
.
Reference to a Transition XML resource defining the desired Transition
used to move Views in to the scene when returning from a previously-started Activity.
Corresponds to
setReenterTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowReenterTransition
.
Reference to a Transition XML resource defining the desired Transition
used to move Views out of the scene when the Window is
preparing to close. Corresponds to
setReturnTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowReturnTransition
.
Reference to a Transition XML resource defining the desired Transition
used to move shared elements transferred into the Window's initial content Scene.
Corresponds to setSharedElementEnterTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowSharedElementEnterTransition
.
Reference to a Transition XML resource defining the desired Transition
used when starting a new Activity to move shared elements prior to transferring
to the called Activity.
Corresponds to setSharedElementExitTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowSharedElementExitTransition
.
Reference to a Transition XML resource defining the desired Transition
used for shared elements transferred back to a calling Activity.
Corresponds to setSharedElementReenterTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowSharedElementReenterTransition
.
Reference to a Transition XML resource defining the desired Transition
used to move shared elements transferred back to a calling Activity.
Corresponds to setSharedElementReturnTransition(android.transition.Transition)
.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol windowSharedElementReturnTransition
.
Indicates whether or not shared elements should use an overlay during transitions. The default value is true.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol windowSharedElementsUseOverlay
.
The duration, in milliseconds, of the window background fade duration
when transitioning into or away from an Activity when called with an
Activity Transition. Corresponds to
setTransitionBackgroundFadeDuration(long)
.
Must be an integer value, such as "100
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol windowTransitionBackgroundFadeDuration
.
This constant is deprecated.
use getDefaultFeatures(android.content.Context)
instead.
The default features enabled.
Flag for enabling the Action Bar. This is enabled by default for some devices. The Action Bar replaces the title bar and provides an alternate location for an on-screen menu button on some devices.
Flag for requesting an Action Bar that overlays window content.
Normally an Action Bar will sit in the space above window content, but if this
feature is requested along with FEATURE_ACTION_BAR
it will be layered over
the window content itself. This is useful if you would like your app to have more control
over how the Action Bar is displayed, such as letting application content scroll beneath
an Action Bar with a transparent background or otherwise displaying a transparent/translucent
Action Bar over application content.
This mode is especially useful with View.SYSTEM_UI_FLAG_FULLSCREEN
, which allows you to seamlessly hide the
action bar in conjunction with other screen decorations.
As of JELLY_BEAN
, when an
ActionBar is in this mode it will adjust the insets provided to
View.fitSystemWindows(Rect)
to include the content covered by the action bar, so you can do layout within
that space.
Flag for specifying the behavior of action modes when an Action Bar is not present. If overlay is enabled, the action mode UI will be allowed to cover existing window content.
Enables Activities to run Activity Transitions either through sending or receiving
ActivityOptions bundle created with
makeSceneTransitionAnimation(android.app.Activity, android.util.Pair[])
or makeSceneTransitionAnimation(android.app.Activity, View, String)
.
Flag for requesting that window content changes should be animated using a TransitionManager.
The TransitionManager is set using
setTransitionManager(android.transition.TransitionManager)
. If none is set,
a default TransitionManager will be used.
Flag for the context menu. This is enabled by default.
Flag for custom title. You cannot combine this feature with other title features.
Flag for indeterminate progress
Flag for having an icon on the left side of the title bar
Flag for the "no title" feature, turning off the title at the top of the screen.
Flag for the "options panel" feature. This is enabled by default.
Flag for the progress indicator feature
Flag for having an icon on the right side of the title bar
Flag for requesting a decoration-free window that is dismissed by swiping from the left.
The ID that the main layout in the XML layout file should have.
The transitionName for the navigation bar background View when a custom background is used.
Ending value for the (primary) progress
Flag for setting the progress bar's indeterminate mode off
Flag for setting the progress bar's indeterminate mode on
Highest possible value for the secondary progress
Lowest possible value for the secondary progress
Starting value for the (primary) progress
Flag for setting the progress bar's visibility to GONE
Flag for setting the progress bar's visibility to VISIBLE
The transitionName for the status bar background View when a custom background is used.
Variation on
setContentView(View, android.view.ViewGroup.LayoutParams)
to add an additional content view to the screen. Added after any existing
ones in the screen -- existing views are NOT removed.
view | The desired content to display. |
---|---|
params | Layout parameters for the view. |
Convenience function to set the flag bits as specified in flags, as
per setFlags(int, int)
.
flags | The flag bits to be set. |
---|
Convenience function to clear the flag bits as specified in flags, as
per setFlags(int, int)
.
flags | The flag bits to be cleared. |
---|
Finds a view that was identified by the id attribute from the XML that
was processed in onCreate(Bundle)
. This will
implicitly call getDecorView()
for you, with all of the
associated side-effects.
Returns how the transition set in
setEnterTransition(android.transition.Transition)
overlaps with the exit
transition of the calling Activity. When true, the transition will start as soon as possible.
When false, the transition will wait until the remote exiting transition completes before
starting.
Returns how the transition set in
setExitTransition(android.transition.Transition)
overlaps with the exit
transition of the called Activity when reentering after if finishes. When true,
the transition will start as soon as possible. When false, the transition will wait
until the called Activity's exiting transition completes before starting.
Retrieve the current window attributes associated with this panel.
Return the current Callback interface for this window.
Return the container for this Window.
Retrieve the Scene
representing this window's current content.
Requires FEATURE_CONTENT_TRANSITIONS
.
This method will return null if the current content is not represented by a Scene.
Return the Context this window policy is running in, for retrieving resources and other information.
Return the view in this Window that currently has focus, or null if there are none. Note that this does not look in any containing Window.
Retrieve the top-level window decor view (containing the standard window frame/decorations and the client's content inside of that), which can be added as a window to the window manager.
Note that calling this function for the first time "locks in"
various window characteristics as described in
setContentView(View, android.view.ViewGroup.LayoutParams)
.
Return the feature bits set by default on a window.
context | The context used to access resources |
---|
Returns the transition used to move Views into the initial scene. The entering
Views will be those that are regular Views or ViewGroups that have
isTransitionGroup()
return true. Typical Transitions will extend
Visibility
as entering is governed by changing visibility from
INVISIBLE
to VISIBLE
. If transition
is null,
entering Views will remain unaffected. Requires FEATURE_ACTIVITY_TRANSITIONS
.
Returns the Transition that will be used to move Views out of the scene when starting a
new Activity. The exiting Views will be those that are regular Views or ViewGroups that
have isTransitionGroup()
return true. Typical Transitions will extend
Visibility
as exiting is governed by changing visibility
from VISIBLE
to INVISIBLE
. If transition is null, the views will
remain unaffected. Requires FEATURE_ACTIVITY_TRANSITIONS
.
Quick access to the LayoutInflater
instance that this Window
retrieved from its Context.
Gets the MediaController
that was previously set.
Returns the Transition that will be used to move Views in to the scene when returning from
a previously-started Activity. The entering Views will be those that are regular Views
or ViewGroups that have isTransitionGroup()
return true. Typical Transitions
will extend Visibility
as exiting is governed by changing
visibility from VISIBLE
to INVISIBLE
.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
Returns he Transition that will be used to move Views out of the scene when the Window is
preparing to close, for example after a call to
finishAfterTransition()
. The exiting
Views will be those that are regular Views or ViewGroups that have
isTransitionGroup()
return true. Typical Transitions will extend
Visibility
as entering is governed by changing visibility from
VISIBLE
to INVISIBLE
.
Returns the Transition that will be used for shared elements transferred into the content
Scene. Requires FEATURE_ACTIVITY_TRANSITIONS
.
Returns the Transition to use for shared elements in the launching Window prior
to transferring to the launched Activity's Window.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
Returns the Transition that will be used for shared elements reentering from a started
Activity after it has returned the shared element to it start location.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
Returns the Transition that will be used for shared elements transferred back to a
calling Activity. Requires FEATURE_ACTIVITY_TRANSITIONS
.
Returns true
when shared elements should use an Overlay during
shared element transitions or false
when they should animate as
part of the normal View hierarchy. The default value is true.
true
when shared elements should use an Overlay during
shared element transitions or false
when they should animate as
part of the normal View hierarchy.Returns the duration, in milliseconds, of the window background fade when transitioning into or away from an Activity when called with an Activity Transition.
When executing the enter transition, the background starts transparent
and fades in. This requires FEATURE_ACTIVITY_TRANSITIONS
. The default is
300 milliseconds.
Retrieve the TransitionManager
responsible for for default transitions
in this window. Requires FEATURE_CONTENT_TRANSITIONS
.
This method will return non-null after content has been initialized (e.g. by using
setContentView(View)
) if FEATURE_CONTENT_TRANSITIONS
has been granted.
Return the window manager allowing this Window to display its own windows.
Return the Window
attributes from this
window's theme.
Query for the availability of a certain feature.
feature | The feature ID to check |
---|
Inject an event to window locally.
event | A key or touch event to inject to this window. |
---|
Return whether this window is being displayed with a floating style
(based on the windowIsFloating
attribute in
the style/theme).
Should be called when the configuration is changed.
newConfig | The new configuration. |
---|
Retrieve the current decor view, but only if it has already been created; otherwise returns null.
Enable extended screen features. This must be called before
setContentView(). May be called as many times as desired as long as it
is before setContentView(). If not called, no extended features
will be available. You can not turn off a feature once it is requested.
You canot use other title features with FEATURE_CUSTOM_TITLE
.
featureId | The desired features, defined as constants by Window. |
---|
Controls how the transition set in
setEnterTransition(android.transition.Transition)
overlaps with the exit
transition of the calling Activity. When true, the transition will start as soon as possible.
When false, the transition will wait until the remote exiting transition completes before
starting.
allow | true to start the enter transition when possible or false to wait until the exiting transition completes. |
---|
Controls how the transition set in
setExitTransition(android.transition.Transition)
overlaps with the exit
transition of the called Activity when reentering after if finishes. When true,
the transition will start as soon as possible. When false, the transition will wait
until the called Activity's exiting transition completes before starting.
allow | true to start the transition when possible or false to wait until the called Activity's exiting transition completes. |
---|
Specify custom window attributes. PLEASE NOTE: the
layout params you give here should generally be from values previously
retrieved with getAttributes()
; you probably do not want to
blindly create and apply your own, since this will blow away any values
set by the framework that you are not interested in.
a | The new window attributes, which will completely override any current values. |
---|
Change the background of this window to a custom Drawable. Setting the background to null will make the window be opaque. To make the window transparent, you can use an empty drawable (for instance a ColorDrawable with the color 0 or the system drawable android:drawable/empty.)
drawable | The new Drawable to use for this window's background. |
---|
Change the background of this window to a Drawable resource. Setting the background to null will make the window be opaque. To make the window transparent, you can use an empty drawable (for instance a ColorDrawable with the color 0 or the system drawable android:drawable/empty.)
resId | The resource identifier of a drawable resource which will be installed as the new background. |
---|
Set the Callback interface for this window, used to intercept key events and other dynamic operations in the window.
callback | The desired Callback interface. |
---|
Sets whether window content should be clipped to the outline of the window background.
clipToOutline | Whether window content should be clipped to the outline of the window background. |
---|
Set the container for this window. If not set, the DecorWindow operates as a top-level window; otherwise, it negotiates with the container to display itself appropriately.
container | The desired containing Window. |
---|
Convenience for
setContentView(View, android.view.ViewGroup.LayoutParams)
to set the screen content from a layout resource. The resource will be
inflated, adding all top-level views to the screen.
layoutResID | Resource ID to be inflated. |
---|
Convenience for
setContentView(View, android.view.ViewGroup.LayoutParams)
set the screen content to an explicit view. This view is placed
directly into the screen's view hierarchy. It can itself be a complex
view hierarhcy.
view | The desired content to display. |
---|
Set the screen content to an explicit view. This view is placed directly into the screen's view hierarchy. It can itself be a complex view hierarchy.
Note that calling this function "locks in" various characteristics
of the window that can not, from this point forward, be changed: the
features that have been requested with requestFeature(int)
,
and certain window flags as described in setFlags(int, int)
.
If FEATURE_CONTENT_TRANSITIONS
is set, the window's
TransitionManager will be used to animate content from the current
content View to view.
view | The desired content to display. |
---|---|
params | Layout parameters for the view. |
Set the amount of dim behind the window when using
FLAG_DIM_BEHIND
. This overrides
the default dim amount of that is selected by the Window based on
its theme.
amount | The new dim amount, from 0 for no dim to 1 for full dim. |
---|
Sets the window elevation.
Changes to this property take effect immediately and will cause the window surface to be recreated. This is an expensive operation and as a result, this property should not be animated.
elevation | The window elevation. |
---|
Sets the Transition that will be used to move Views into the initial scene. The entering
Views will be those that are regular Views or ViewGroups that have
isTransitionGroup()
return true. Typical Transitions will extend
Visibility
as entering is governed by changing visibility from
INVISIBLE
to VISIBLE
. If transition
is null,
entering Views will remain unaffected.
transition | The Transition to use to move Views into the initial Scene. |
---|
Sets the Transition that will be used to move Views out of the scene when starting a
new Activity. The exiting Views will be those that are regular Views or ViewGroups that
have isTransitionGroup()
return true. Typical Transitions will extend
Visibility
as exiting is governed by changing visibility
from VISIBLE
to INVISIBLE
. If transition is null, the views will
remain unaffected. Requires FEATURE_ACTIVITY_TRANSITIONS
.
transition | The Transition to use to move Views out of the scene when calling a new Activity. |
---|
Set an explicit Drawable value for feature of this window. You must have called requestFeature(featureId) before calling this function.
featureId | The desired drawable feature to change. Features are constants defined by Window. |
---|---|
drawable | A Drawable object to display. |
Set a custom alpha value for the given drawable feature, controlling how much the background is visible through it.
featureId | The desired drawable feature to change. Features are constants defined by Window. |
---|---|
alpha | The alpha amount, 0 is completely transparent and 255 is completely opaque. |
Set the value for a drawable feature of this window, from a resource identifier. You must have called requestFeauture(featureId) before calling this function.
featureId | The desired drawable feature to change, defined as a constant by Window. |
---|---|
resId | Resource identifier of the desired image. |
Set the value for a drawable feature of this window, from a URI. You must have called requestFeature(featureId) before calling this function.
The only URI currently supported is "content:", specifying an image in a content provider.
featureId | The desired drawable feature to change. Features are constants defined by Window. |
---|---|
uri | The desired URI. |
Set the integer value for a feature. The range of the value depends on
the feature being set. For FEATURE_PROGRESS
, it should go from
0 to 10000. At 10000 the progress is complete and the indicator hidden.
featureId | The desired feature to change. Features are constants defined by Window. |
---|---|
value | The value for the feature. The interpretation of this value is feature-specific. |
Set the flags of the window, as per the
WindowManager.LayoutParams
flags.
Note that some flags must be set before the window decoration is
created (by the first call to
setContentView(View, android.view.ViewGroup.LayoutParams)
or
getDecorView()
:
FLAG_LAYOUT_IN_SCREEN
and
FLAG_LAYOUT_INSET_DECOR
. These
will be set for you based on the windowIsFloating
attribute.
flags | The new window flags (see WindowManager.LayoutParams). |
---|---|
mask | Which of the window flag bits to modify. |
Set the format of window, as per the PixelFormat types. This overrides the default format that is selected by the Window based on its window decorations.
format | The new window format (see PixelFormat). Use PixelFormat.UNKNOWN to allow the Window to select the format. |
---|
Set the gravity of the window, as per the Gravity constants. This controls how the window manager is positioned in the overall window; it is only useful when using WRAP_CONTENT for the layout width or height.
gravity | The desired gravity constant. |
---|
Set the primary icon for this window.
resId | resource ID of a drawable to set |
---|
Set the width and height layout parameters of the window. The default for both of these is MATCH_PARENT; you can change them to WRAP_CONTENT or an absolute value to make a window that is not full-screen.
width | The desired layout width of the window. |
---|---|
height | The desired layout height of the window. |
Set focus locally. The window should have the
FLAG_LOCAL_FOCUS_MODE
flag set already.
hasFocus | Whether this window has focus or not. |
---|---|
inTouchMode | Whether this window is in touch mode or not. |
Set the logo for this window. A logo is often shown in place of an
icon
but is generally wider and communicates window title information
as well.
resId | resource ID of a drawable to set |
---|
Sets a MediaController
to send media keys and volume changes to.
If set, this should be preferred for all media keys and volume requests
sent to this window.
controller | The controller for the session which should receive media keys and volume changes. |
---|
Sets the color of the navigation bar to .
For this to take effect,
the window must be drawing the system bar backgrounds with
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
and
FLAG_TRANSLUCENT_NAVIGATION
must not be set.
If is not opaque, consider setting
SYSTEM_UI_FLAG_LAYOUT_STABLE
and
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
.
The transitionName for the view background will be "android:navigation:background".
Sets the Transition that will be used to move Views in to the scene when returning from
a previously-started Activity. The entering Views will be those that are regular Views
or ViewGroups that have isTransitionGroup()
return true. Typical Transitions
will extend Visibility
as exiting is governed by changing
visibility from VISIBLE
to INVISIBLE
. If transition is null,
the views will remain unaffected. If nothing is set, the default will be to use the same
transition as setExitTransition(android.transition.Transition)
.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
transition | The Transition to use to move Views into the scene when reentering from a previously-started Activity. |
---|
Sets the Transition that will be used to move Views out of the scene when the Window is
preparing to close, for example after a call to
finishAfterTransition()
. The exiting
Views will be those that are regular Views or ViewGroups that have
isTransitionGroup()
return true. Typical Transitions will extend
Visibility
as entering is governed by changing visibility from
VISIBLE
to INVISIBLE
. If transition
is null,
entering Views will remain unaffected. If nothing is set, the default will be to
use the same value as set in setEnterTransition(android.transition.Transition)
.
transition | The Transition to use to move Views out of the Scene when the Window is preparing to close. |
---|
Sets the Transition that will be used for shared elements transferred into the content
Scene. Typical Transitions will affect size and location, such as
ChangeBounds
. A null
value will cause transferred shared elements to blink to the final position.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
transition | The Transition to use for shared elements transferred into the content Scene. |
---|
Sets the Transition that will be used for shared elements after starting a new Activity
before the shared elements are transferred to the called Activity. If the shared elements
must animate during the exit transition, this Transition should be used. Upon completion,
the shared elements may be transferred to the started Activity.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
transition | The Transition to use for shared elements in the launching Window prior to transferring to the launched Activity's Window. |
---|
Sets the Transition that will be used for shared elements reentering from a started
Activity after it has returned the shared element to it start location. If no value
is set, this will default to
setSharedElementExitTransition(android.transition.Transition)
.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
transition | The Transition to use for shared elements in the launching Window after the shared element has returned to the Window. |
---|
Sets the Transition that will be used for shared elements transferred back to a
calling Activity. Typical Transitions will affect size and location, such as
ChangeBounds
. A null
value will cause transferred shared elements to blink to the final position.
If no value is set, the default will be to use the same value as
setSharedElementEnterTransition(android.transition.Transition)
.
Requires FEATURE_ACTIVITY_TRANSITIONS
.
transition | The Transition to use for shared elements transferred out of the content Scene. |
---|
Sets whether or not shared elements should use an Overlay during shared element transitions. The default value is true.
sharedElementsUseOverlay | true indicates that shared elements should
be transitioned with an Overlay or false
to transition within the normal View hierarchy. |
---|
Specify an explicit soft input mode to use for the window, as per
WindowManager.LayoutParams.softInputMode
. Providing anything besides
"unspecified" here will override the input mode the window would
normally retrieve from its theme.
Sets the color of the status bar to .
For this to take effect,
the window must be drawing the system bar backgrounds with
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
and
FLAG_TRANSLUCENT_STATUS
must not be set.
If is not opaque, consider setting
SYSTEM_UI_FLAG_LAYOUT_STABLE
and
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
.
The transitionName for the view background will be "android:status:background".
Sets the duration, in milliseconds, of the window background fade when transitioning into or away from an Activity when called with an Activity Transition.
When executing the enter transition, the background starts transparent
and fades in. This requires FEATURE_ACTIVITY_TRANSITIONS
. The default is
300 milliseconds.
fadeDurationMillis | The duration of the window background fade to or from opaque during enter transition. |
---|
Set the TransitionManager
to use for default transitions in this window.
Requires FEATURE_CONTENT_TRANSITIONS
.
tm | The TransitionManager to use for scene changes. |
---|
Set the type of the window, as per the WindowManager.LayoutParams types.
type | The new window type (see WindowManager.LayoutParams). |
---|
Set extra options that will influence the UI for this window.
uiOptions | Flags specifying extra options for this window. |
---|
Set extra options that will influence the UI for this window. Only the bits filtered by mask will be modified.
uiOptions | Flags specifying extra options for this window. |
---|---|
mask | Flags specifying which options should be modified. Others will remain unchanged. |
Specify custom animations to use for the window, as per
WindowManager.LayoutParams.windowAnimations
. Providing anything besides
0 here will override the animations the window would
normally retrieve from its theme.
Set the window manager for use by this Window to, for example, display panels. This is not used for displaying the Window itself -- that must be done by the client.
wm | The window manager for adding new windows. |
---|
Set the window manager for use by this Window to, for example, display panels. This is not used for displaying the Window itself -- that must be done by the client.
wm | The window manager for adding new windows. |
---|
Used by custom windows, such as Dialog, to pass the generic motion event further down the view hierarchy. Application developers should not need to implement or call this.
Used by custom windows, such as Dialog, to pass the key press event further down the view hierarchy. Application developers should not need to implement or call this.
Used by custom windows, such as Dialog, to pass the key shortcut press event further down the view hierarchy. Application developers should not need to implement or call this.
Used by custom windows, such as Dialog, to pass the touch screen event further down the view hierarchy. Application developers should not need to implement or call this.
Used by custom windows, such as Dialog, to pass the trackball event further down the view hierarchy. Application developers should not need to implement or call this.
Take ownership of this window's InputQueue. The window will no longer read and dispatch input events from the queue; it is your responsibility to do so.
Request that key events come to this activity. Use this if your activity has no views with focus, but the activity still wants a chance to process key events.
Take ownership of this window's surface. The window's view hierarchy will no longer draw into the surface, though it will otherwise continue to operate (such as for receiving input events). The given SurfaceHolder callback will be used to tell you about state changes to the surface.
Return the feature bits that are enabled. This is the set of features that were given to requestFeature(), and are being handled by this Window itself or its container. That is, it is the set of requested features that you can actually use.
To do: add a public version of this API that allows you to check for features by their feature ID.
Return the window flags that have been explicitly set by the client,
so will not be modified by getDecorView()
.
Return the feature bits that are being implemented by this Window. This is the set of features that were given to requestFeature(), and are being handled by only this Window itself, not by its containers.
Has the app specified their own soft input mode?
Set the default format of window, as per the PixelFormat types. This is the format that will be used unless the client specifies in explicit format with setFormat();
format | The new window format (see PixelFormat). |
---|