public static class WindowManager.LayoutParams extends ViewGroup.LayoutParams implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
float |
alpha
An alpha value to apply to this entire window.
|
static int |
ALPHA_CHANGED |
static int |
ANIMATION_CHANGED |
static float |
BRIGHTNESS_OVERRIDE_FULL
Value for
screenBrightness and buttonBrightness
indicating that the screen or button backlight brightness should be set
to the hightest value when this window is in front. |
static float |
BRIGHTNESS_OVERRIDE_NONE
Default value for
screenBrightness and buttonBrightness
indicating that the brightness value is not overridden for this window
and normal brightness policy should be used. |
static float |
BRIGHTNESS_OVERRIDE_OFF
Value for
screenBrightness and buttonBrightness
indicating that the screen or button backlight brightness should be set
to the lowest value when this window is in front. |
static int |
BUTTON_BRIGHTNESS_CHANGED |
float |
buttonBrightness
This can be used to override the standard behavior of the button and
keyboard backlights.
|
static Parcelable.Creator<WindowManager.LayoutParams> |
CREATOR |
static int |
DIM_AMOUNT_CHANGED |
float |
dimAmount
When
FLAG_DIM_BEHIND is set, this is the amount of dimming
to apply. |
static int |
EVERYTHING_CHANGED |
static int |
FIRST_APPLICATION_WINDOW
Start of window types that represent normal application windows.
|
static int |
FIRST_SUB_WINDOW
Start of types of sub-windows.
|
static int |
FIRST_SYSTEM_WINDOW
Start of system-specific window types.
|
static int |
FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
Window flag: as long as this window is visible to the user, allow
the lock screen to activate while the screen is on.
|
static int |
FLAG_ALT_FOCUSABLE_IM
Window flag: invert the state of
FLAG_NOT_FOCUSABLE with
respect to how this window interacts with the current method. |
static int |
FLAG_BLUR_BEHIND
Deprecated.
Blurring is no longer supported.
|
static int |
FLAG_COMPATIBLE_WINDOW
Window flag: special flag to limit the size of the window to be
original size ([320x480] x density).
|
static int |
FLAG_DIM_BEHIND
Window flag: everything behind this window will be dimmed.
|
static int |
FLAG_DISMISS_KEYGUARD
Window flag: when set the window will cause the keyguard to
be dismissed, only if it is not a secure lock keyguard.
|
static int |
FLAG_DITHER
Deprecated.
This flag is no longer used.
|
static int |
FLAG_FORCE_NOT_FULLSCREEN
Window flag: Override {@link #FLAG_FULLSCREEN and force the
screen decorations (such as status bar) to be shown.
|
static int |
FLAG_FULLSCREEN
Window flag: Hide all screen decorations (e.g.
|
static int |
FLAG_HARDWARE_ACCELERATED
Indicates whether this window should be hardware accelerated.
|
static int |
FLAG_IGNORE_CHEEK_PRESSES
Window flag: intended for windows that will often be used when the user is
holding the screen against their face, it will aggressively filter the event
stream to prevent unintended presses in this situation that may not be
desired for a particular window, when such an event stream is detected, the
application will receive a CANCEL motion event to indicate this so applications
can handle this accordingly by taking no action on the event
until the finger is released.
|
static int |
FLAG_KEEP_SCREEN_ON
Window flag: as long as this window is visible to the user, keep
the device's screen turned on and bright.
|
static int |
FLAG_LAYOUT_IN_SCREEN
Window flag: place the window within the entire screen, ignoring
decorations around the border (a.k.a.
|
static int |
FLAG_LAYOUT_INSET_DECOR
Window flag: a special option only for use in combination with
FLAG_LAYOUT_IN_SCREEN . |
static int |
FLAG_LAYOUT_NO_LIMITS
Window flag: allow window to extend outside of the screen.
|
static int |
FLAG_NEEDS_MENU_KEY
Flag for a window belonging to an activity that responds to
KeyEvent.KEYCODE_MENU
and therefore needs a Menu key. |
static int |
FLAG_NOT_FOCUSABLE
Window flag: this window won't ever get key input focus, so the
user can not send key or other button events to it.
|
static int |
FLAG_NOT_TOUCH_MODAL
Window flag: Even when this window is focusable (its
{@link #FLAG_NOT_FOCUSABLE is not set), allow any pointer events
outside of the window to be sent to the windows behind it.
|
static int |
FLAG_NOT_TOUCHABLE
Window flag: this window can never receive touch events.
|
static int |
FLAG_SCALED
Window flag: a special mode where the layout parameters are used
to perform scaling of the surface when it is composited to the
screen.
|
static int |
FLAG_SECURE
Window flag: Treat the content of the window as secure, preventing
it from appearing in screenshots or from being viewed on non-secure
displays.
|
static int |
FLAG_SHOW_WALLPAPER
Window flag: ask that the system wallpaper be shown behind
your window.
|
static int |
FLAG_SHOW_WHEN_LOCKED
Window flag: special flag to let windows be shown when the screen
is locked.
|
static int |
FLAG_SLIPPERY
Window flag: Enable touches to slide out of a window into neighboring
windows in mid-gesture instead of being captured for the duration of
the gesture.
|
static int |
FLAG_SPLIT_TOUCH
Window flag: when set the window will accept for touch events
outside of its bounds to be sent to other windows that also
support split touch.
|
static int |
FLAG_SYSTEM_ERROR
Window flag: a special option intended for system dialogs.
|
static int |
FLAG_TOUCHABLE_WHEN_WAKING
Window flag: When set, if the device is asleep when the touch
screen is pressed, you will receive this first touch event.
|
static int |
FLAG_TURN_SCREEN_ON
Window flag: when set as a window is being added or made
visible, once the window has been shown then the system will
poke the power manager's user activity (as if the user had woken
up the device) to turn the screen on.
|
static int |
FLAG_WATCH_OUTSIDE_TOUCH
Window flag: if you have set
FLAG_NOT_TOUCH_MODAL , you
can set this flag to receive a single special MotionEvent with
the action
MotionEvent.ACTION_OUTSIDE for
touches that occur outside of your window. |
int |
flags
Various behavioral options/flags.
|
static int |
FLAGS_CHANGED |
int |
format
The desired bitmap format.
|
static int |
FORMAT_CHANGED |
int |
gravity
Placement of window within the screen as per
Gravity . |
boolean |
hasSystemUiListeners
Get callbacks about the system ui visibility changing.
|
float |
horizontalMargin
The horizontal margin, as a percentage of the container's width,
between the container and the widget.
|
float |
horizontalWeight
Indicates how much of the extra space will be allocated horizontally
to the view associated with these LayoutParams.
|
static int |
INPUT_FEATURE_DISABLE_POINTER_GESTURES
When this window has focus, disable touch pad pointer gesture processing.
|
static int |
INPUT_FEATURE_DISABLE_USER_ACTIVITY
When this window has focus, does not call user activity for all input events so
the application will have to do it itself.
|
static int |
INPUT_FEATURE_NO_INPUT_CHANNEL
Does not construct an input channel for this window.
|
static int |
INPUT_FEATURES_CHANGED |
int |
inputFeatures
Control special features of the input subsystem.
|
static int |
LAST_APPLICATION_WINDOW
End of types of application windows.
|
static int |
LAST_SUB_WINDOW
End of types of sub-windows.
|
static int |
LAST_SYSTEM_WINDOW
End of types of system windows.
|
static int |
LAYOUT_CHANGED |
static int |
MEMORY_TYPE_CHANGED |
static int |
MEMORY_TYPE_GPU
Deprecated.
this is ignored, this value is set automatically when needed.
|
static int |
MEMORY_TYPE_HARDWARE
Deprecated.
this is ignored, this value is set automatically when needed.
|
static int |
MEMORY_TYPE_NORMAL
Deprecated.
this is ignored, this value is set automatically when needed.
|
static int |
MEMORY_TYPE_PUSH_BUFFERS
Deprecated.
this is ignored, this value is set automatically when needed.
|
int |
memoryType
Deprecated.
this is ignored
|
String |
packageName
Name of the package owning this window.
|
static int |
PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED
If the window has requested hardware acceleration, but this is not
allowed in the process it is in, then still render it as if it is
hardware accelerated.
|
static int |
PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED
In the system process, we globally do not use hardware acceleration
because there are many threads doing UI there and they conflict.
|
static int |
PRIVATE_FLAG_SET_NEEDS_MENU_KEY
This is set for a window that has explicitly specified its
FLAG_NEEDS_MENU_KEY, so we know the value on this window is the
appropriate one to use.
|
static int |
PRIVATE_FLAG_SHOW_FOR_ALL_USERS
In a multiuser system if this flag is set and the owner is a system process then this
window will appear on all user screens.
|
static int |
PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS
By default, wallpapers are sent new offsets when the wallpaper is scrolled.
|
static int |
PRIVATE_FLAGS_CHANGED |
int |
privateFlags
Control flags that are private to the platform.
|
static int |
SCREEN_BRIGHTNESS_CHANGED |
static int |
SCREEN_ORIENTATION_CHANGED |
float |
screenBrightness
This can be used to override the user's preferred brightness of
the screen.
|
int |
screenOrientation
Specific orientation value for a window.
|
static int |
SOFT_INPUT_ADJUST_NOTHING
Adjustment option for
softInputMode : set to have a window
not adjust for a shown input method. |
static int |
SOFT_INPUT_ADJUST_PAN
Adjustment option for
softInputMode : set to have a window
pan when an input method is
shown, so it doesn't need to deal with resizing but just panned
by the framework to ensure the current input focus is visible. |
static int |
SOFT_INPUT_ADJUST_RESIZE
Adjustment option for
softInputMode : set to allow the
window to be resized when an input
method is shown, so that its contents are not covered by the input
method. |
static int |
SOFT_INPUT_ADJUST_UNSPECIFIED
Adjustment option for
softInputMode : nothing specified. |
static int |
SOFT_INPUT_IS_FORWARD_NAVIGATION
Bit for
softInputMode : set when the user has navigated
forward to the window. |
static int |
SOFT_INPUT_MASK_ADJUST
Mask for
softInputMode of the bits that determine the
way that the window should be adjusted to accommodate the soft
input window. |
static int |
SOFT_INPUT_MASK_STATE
Mask for
softInputMode of the bits that determine the
desired visibility state of the soft input area for this window. |
static int |
SOFT_INPUT_MODE_CHANGED |
static int |
SOFT_INPUT_STATE_ALWAYS_HIDDEN
Visibility state for
softInputMode : please always hide any
soft input area when this window receives focus. |
static int |
SOFT_INPUT_STATE_ALWAYS_VISIBLE
Visibility state for
softInputMode : please always make the
soft input area visible when this window receives input focus. |
static int |
SOFT_INPUT_STATE_HIDDEN
Visibility state for
softInputMode : please hide any soft input
area when normally appropriate (when the user is navigating
forward to your window). |
static int |
SOFT_INPUT_STATE_UNCHANGED
Visibility state for
softInputMode : please don't change the state of
the soft input area. |
static int |
SOFT_INPUT_STATE_UNSPECIFIED
Visibility state for
softInputMode : no state has been specified. |
static int |
SOFT_INPUT_STATE_VISIBLE
Visibility state for
softInputMode : please show the soft
input area when normally appropriate (when the user is navigating
forward to your window). |
int |
softInputMode
Desired operating mode for any soft input area.
|
int |
subtreeSystemUiVisibility |
static int |
SYSTEM_UI_LISTENER_CHANGED |
static int |
SYSTEM_UI_VISIBILITY_CHANGED |
int |
systemUiVisibility
Control the visibility of the status bar.
|
static int |
TITLE_CHANGED |
IBinder |
token
Identifier for this window.
|
int |
type
The general type of window.
|
static int |
TYPE_APPLICATION
Window type: a normal application window.
|
static int |
TYPE_APPLICATION_ATTACHED_DIALOG
Window type: like
TYPE_APPLICATION_PANEL , but layout
of the window happens as that of a top-level window, not
as a child of its container. |
static int |
TYPE_APPLICATION_MEDIA
Window type: window for showing media (e.g.
|
static int |
TYPE_APPLICATION_MEDIA_OVERLAY
Window type: window for showing overlays on top of media windows.
|
static int |
TYPE_APPLICATION_PANEL
Window type: a panel on top of an application window.
|
static int |
TYPE_APPLICATION_STARTING
Window type: special application window that is displayed while the
application is starting.
|
static int |
TYPE_APPLICATION_SUB_PANEL
Window type: a sub-panel on top of an application window.
|
static int |
TYPE_BASE_APPLICATION
Window type: an application window that serves as the "base" window
of the overall application; all other application windows will
appear on top of it.
|
static int |
TYPE_BOOT_PROGRESS
Window type: The boot progress dialog, goes on top of everything
in the world.
|
static int |
TYPE_CHANGED |
static int |
TYPE_DISPLAY_OVERLAY
Window type: Display overlay window.
|
static int |
TYPE_DRAG
Window type: the drag-and-drop pseudowindow.
|
static int |
TYPE_DREAM
Window type: Dreams (screen saver) window, just above keyguard.
|
static int |
TYPE_HIDDEN_NAV_CONSUMER
Window type: Fake window to consume touch events when the navigation
bar is hidden.
|
static int |
TYPE_INPUT_METHOD
Window type: internal input methods windows, which appear above
the normal UI.
|
static int |
TYPE_INPUT_METHOD_DIALOG
Window type: internal input methods dialog windows, which appear above
the current input method window.
|
static int |
TYPE_KEYGUARD
Window type: keyguard window.
|
static int |
TYPE_KEYGUARD_DIALOG
Window type: dialogs that the keyguard shows
In multiuser systems shows on all users' windows.
|
static int |
TYPE_MAGNIFICATION_OVERLAY
Window type: Magnification overlay window.
|
static int |
TYPE_NAVIGATION_BAR
Window type: Navigation bar (when distinct from status bar)
In multiuser systems shows on all users' windows.
|
static int |
TYPE_NAVIGATION_BAR_PANEL
Window type: Navigation bar panel (when navigation bar is distinct from status bar)
In multiuser systems shows on all users' windows.
|
static int |
TYPE_PHONE
Window type: phone.
|
static int |
TYPE_POINTER
Window type: (mouse) pointer
In multiuser systems shows on all users' windows.
|
static int |
TYPE_PRIORITY_PHONE
Window type: priority phone UI, which needs to be displayed even if
the keyguard is active.
|
static int |
TYPE_RECENTS_OVERLAY
Window type: Recents.
|
static int |
TYPE_SEARCH_BAR
Window type: the search bar.
|
static int |
TYPE_SECURE_SYSTEM_OVERLAY
Window type: secure system overlay windows, which need to be displayed
on top of everything else.
|
static int |
TYPE_STATUS_BAR
Window type: the status bar.
|
static int |
TYPE_STATUS_BAR_PANEL
Window type: panel that slides out from over the status bar
In multiuser systems shows on all users' windows.
|
static int |
TYPE_STATUS_BAR_SUB_PANEL
Window type: panel that slides out from under the status bar
In multiuser systems shows on all users' windows.
|
static int |
TYPE_SYSTEM_ALERT
Window type: system window, such as low power alert.
|
static int |
TYPE_SYSTEM_DIALOG
Window type: panel that slides out from the status bar
In multiuser systems shows on all users' windows.
|
static int |
TYPE_SYSTEM_ERROR
Window type: internal system error windows, appear on top of
everything they can.
|
static int |
TYPE_SYSTEM_OVERLAY
Window type: system overlay windows, which need to be displayed
on top of everything else.
|
static int |
TYPE_TOAST
Window type: transient notifications.
|
static int |
TYPE_UNIVERSE_BACKGROUND
Window type: Behind the universe of the real windows.
|
static int |
TYPE_VOLUME_OVERLAY
Window type: The volume level overlay/dialog shown when the user
changes the system volume.
|
static int |
TYPE_WALLPAPER
Window type: wallpaper window, placed behind any window that wants
to sit on top of the wallpaper.
|
static int |
USER_ACTIVITY_TIMEOUT_CHANGED |
long |
userActivityTimeout
Sets the number of milliseconds before the user activity timeout occurs
when this window has focus.
|
float |
verticalMargin
The vertical margin, as a percentage of the container's height,
between the container and the widget.
|
float |
verticalWeight
Indicates how much of the extra space will be allocated vertically
to the view associated with these LayoutParams.
|
int |
windowAnimations
A style resource defining the animations to use for this window.
|
int |
x
X position for this window.
|
int |
y
Y position for this window.
|
FILL_PARENT, height, layoutAnimationParameters, MATCH_PARENT, width, WRAP_CONTENT
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
WindowManager.LayoutParams() |
WindowManager.LayoutParams(int _type) |
WindowManager.LayoutParams(int _type,
int _flags) |
WindowManager.LayoutParams(int _type,
int _flags,
int _format) |
WindowManager.LayoutParams(int w,
int h,
int _type,
int _flags,
int _format) |
WindowManager.LayoutParams(int w,
int h,
int xpos,
int ypos,
int _type,
int _flags,
int _format) |
WindowManager.LayoutParams(Parcel in) |
Modifier and Type | Method and Description |
---|---|
int |
copyFrom(WindowManager.LayoutParams o) |
String |
debug(String output)
Returns a String representation of this set of layout parameters.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
CharSequence |
getTitle() |
static boolean |
mayUseInputMethod(int flags)
Given a particular set of window manager flags, determine whether
such a window may be a target for an input method when it has
focus.
|
void |
scale(float scale)
Scale the layout params' coordinates and size.
|
void |
setTitle(CharSequence title) |
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
void |
writeToParcel(Parcel out,
int parcelableFlags)
Flatten this object in to a Parcel.
|
onDebugDraw, resolveLayoutDirection, setBaseAttributes, sizeToString
public int x
Gravity.LEFT
or Gravity.START
or Gravity.RIGHT
or
Gravity.END
it provides an offset from the given edge.public int y
Gravity.TOP
or Gravity.BOTTOM
it provides
an offset from the given edge.public float horizontalWeight
public float verticalWeight
public int type
FIRST_APPLICATION_WINDOW
to
LAST_APPLICATION_WINDOW
) are normal top-level application
windows. For these types of windows, the token
must be
set to the token of the activity they are a part of (this will
normally be done for you if token
is null).
FIRST_SUB_WINDOW
to
LAST_SUB_WINDOW
) are associated with another top-level
window. For these types of windows, the token
must be
the token of the window it is attached to.
FIRST_SYSTEM_WINDOW
to
LAST_SYSTEM_WINDOW
) are special types of windows for
use by the system for specific purposes. They should not normally
be used by applications, and a special permission is required
to use them.
TYPE_BASE_APPLICATION
,
TYPE_APPLICATION
,
TYPE_APPLICATION_STARTING
,
TYPE_APPLICATION_PANEL
,
TYPE_APPLICATION_MEDIA
,
TYPE_APPLICATION_SUB_PANEL
,
TYPE_APPLICATION_ATTACHED_DIALOG
,
TYPE_STATUS_BAR
,
TYPE_SEARCH_BAR
,
TYPE_PHONE
,
TYPE_SYSTEM_ALERT
,
TYPE_KEYGUARD
,
TYPE_TOAST
,
TYPE_SYSTEM_OVERLAY
,
TYPE_PRIORITY_PHONE
,
TYPE_STATUS_BAR_PANEL
,
TYPE_SYSTEM_DIALOG
,
TYPE_KEYGUARD_DIALOG
,
TYPE_SYSTEM_ERROR
,
TYPE_INPUT_METHOD
,
TYPE_INPUT_METHOD_DIALOG
public static final int FIRST_APPLICATION_WINDOW
public static final int TYPE_BASE_APPLICATION
public static final int TYPE_APPLICATION
token
must be
an Activity token identifying who the window belongs to.
In multiuser systems shows only on the owning user's window.public static final int TYPE_APPLICATION_STARTING
public static final int LAST_APPLICATION_WINDOW
public static final int FIRST_SUB_WINDOW
token
of these windows
must be set to the window they are attached to. These types of
windows are kept next to their attached window in Z-order, and their
coordinate space is relative to their attached window.public static final int TYPE_APPLICATION_PANEL
public static final int TYPE_APPLICATION_MEDIA
public static final int TYPE_APPLICATION_SUB_PANEL
TYPE_APPLICATION_PANEL
panels.public static final int TYPE_APPLICATION_ATTACHED_DIALOG
TYPE_APPLICATION_PANEL
, but layout
of the window happens as that of a top-level window, not
as a child of its container.public static final int TYPE_APPLICATION_MEDIA_OVERLAY
public static final int LAST_SUB_WINDOW
public static final int FIRST_SYSTEM_WINDOW
public static final int TYPE_STATUS_BAR
public static final int TYPE_SEARCH_BAR
public static final int TYPE_PHONE
public static final int TYPE_SYSTEM_ALERT
public static final int TYPE_KEYGUARD
public static final int TYPE_TOAST
public static final int TYPE_SYSTEM_OVERLAY
public static final int TYPE_PRIORITY_PHONE
public static final int TYPE_SYSTEM_DIALOG
public static final int TYPE_KEYGUARD_DIALOG
public static final int TYPE_SYSTEM_ERROR
public static final int TYPE_INPUT_METHOD
public static final int TYPE_INPUT_METHOD_DIALOG
public static final int TYPE_WALLPAPER
public static final int TYPE_STATUS_BAR_PANEL
public static final int TYPE_SECURE_SYSTEM_OVERLAY
TYPE_SYSTEM_OVERLAY
except that only the
system itself is allowed to create these overlays. Applications cannot
obtain permission to create secure system overlays.
In multiuser systems shows only on the owning user's window.public static final int TYPE_DRAG
public static final int TYPE_STATUS_BAR_SUB_PANEL
public static final int TYPE_POINTER
public static final int TYPE_NAVIGATION_BAR
public static final int TYPE_VOLUME_OVERLAY
public static final int TYPE_BOOT_PROGRESS
public static final int TYPE_HIDDEN_NAV_CONSUMER
public static final int TYPE_DREAM
public static final int TYPE_NAVIGATION_BAR_PANEL
public static final int TYPE_UNIVERSE_BACKGROUND
public static final int TYPE_DISPLAY_OVERLAY
public static final int TYPE_MAGNIFICATION_OVERLAY
public static final int TYPE_RECENTS_OVERLAY
TYPE_SYSTEM_DIALOG
but only appears on
one user's screen.
In multiuser systems shows on all users' windows.public static final int LAST_SYSTEM_WINDOW
@Deprecated public static final int MEMORY_TYPE_NORMAL
@Deprecated public static final int MEMORY_TYPE_HARDWARE
@Deprecated public static final int MEMORY_TYPE_GPU
@Deprecated public static final int MEMORY_TYPE_PUSH_BUFFERS
@Deprecated public int memoryType
public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
FLAG_KEEP_SCREEN_ON
and/or FLAG_SHOW_WHEN_LOCKED
public static final int FLAG_DIM_BEHIND
dimAmount
to control the amount of dim.@Deprecated public static final int FLAG_BLUR_BEHIND
public static final int FLAG_NOT_FOCUSABLE
FLAG_NOT_TOUCH_MODAL
whether or not that
is explicitly set.
Setting this flag also implies that the window will not need to
interact with
a soft input method, so it will be Z-ordered and positioned
independently of any active input method (typically this means it
gets Z-ordered on top of the input method, so it can use the full
screen for its content and cover the input method if needed. You
can use FLAG_ALT_FOCUSABLE_IM
to modify this behavior.
public static final int FLAG_NOT_TOUCHABLE
public static final int FLAG_NOT_TOUCH_MODAL
public static final int FLAG_TOUCHABLE_WHEN_WAKING
public static final int FLAG_KEEP_SCREEN_ON
public static final int FLAG_LAYOUT_IN_SCREEN
Window.setFlags(int, int)
.public static final int FLAG_LAYOUT_NO_LIMITS
public static final int FLAG_FULLSCREEN
public static final int FLAG_FORCE_NOT_FULLSCREEN
@Deprecated public static final int FLAG_DITHER
public static final int FLAG_SECURE
See Display.FLAG_SECURE
for more details about
secure surfaces and secure displays.
public static final int FLAG_SCALED
public static final int FLAG_IGNORE_CHEEK_PRESSES
public static final int FLAG_LAYOUT_INSET_DECOR
FLAG_LAYOUT_IN_SCREEN
. When requesting layout in the
screen your window may appear on top of or behind screen decorations
such as the status bar. By also including this flag, the window
manager will report the inset rectangle needed to ensure your
content is not covered by screen decorations. This flag is normally
set for you by Window as described in Window.setFlags(int, int)
.public static final int FLAG_ALT_FOCUSABLE_IM
FLAG_NOT_FOCUSABLE
with
respect to how this window interacts with the current method. That
is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
window will behave as if it needs to interact with the input method
and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
not set and this flag is set, then the window will behave as if it
doesn't need to interact with the input method and can be placed
to use more space and cover the input method.public static final int FLAG_WATCH_OUTSIDE_TOUCH
FLAG_NOT_TOUCH_MODAL
, you
can set this flag to receive a single special MotionEvent with
the action
MotionEvent.ACTION_OUTSIDE
for
touches that occur outside of your window. Note that you will not
receive the full down/move/up gesture, only the location of the
first down as an ACTION_OUTSIDE.public static final int FLAG_SHOW_WHEN_LOCKED
FLAG_KEEP_SCREEN_ON
to turn screen on and display windows
directly before showing the key guard window. Can be used with
FLAG_DISMISS_KEYGUARD
to automatically fully dismisss
non-secure keyguards. This flag only applies to the top-most
full-screen window.public static final int FLAG_SHOW_WALLPAPER
public static final int FLAG_TURN_SCREEN_ON
public static final int FLAG_DISMISS_KEYGUARD
FLAG_SHOW_WHEN_LOCKED
, which will only temporarily
hide both secure and non-secure keyguards but ensure they reappear
when the user moves to another UI that doesn't hide them).
If the keyguard is currently active and is secure (requires an
unlock pattern) than the user will still need to confirm it before
seeing this window, unless FLAG_SHOW_WHEN_LOCKED
has
also been set.public static final int FLAG_SPLIT_TOUCH
public static final int FLAG_HARDWARE_ACCELERATED
Indicates whether this window should be hardware accelerated. Requesting hardware acceleration does not guarantee it will happen.
This flag can be controlled programmatically only to enable hardware acceleration. To enable hardware acceleration for a given window programmatically, do the following:
Window w = activity.getWindow(); // in Activity's onCreate() for instance w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
It is important to remember that this flag must be set before setting the content view of your activity or dialog.
This flag cannot be used to disable hardware acceleration after it
was enabled in your manifest using
android.R.attr#hardwareAccelerated
. If you need to selectively
and programmatically disable hardware acceleration (for automated testing
for instance), make sure it is turned off in your manifest and enable it
on your activity or dialog when you need it instead, using the method
described above.
This flag is automatically set by the system if the
android:hardwareAccelerated
XML attribute is set to true on an activity or on the application.
public static final int FLAG_SLIPPERY
public static final int FLAG_NEEDS_MENU_KEY
KeyEvent.KEYCODE_MENU
and therefore needs a Menu key. For devices where Menu is a physical button this flag is
ignored, but on devices where the Menu key is drawn in software it may be hidden unless
this flag is set.
(Note that Action Bars, when available, are the preferred way to offer additional
functions otherwise accessed via an options menu.)
public static final int FLAG_COMPATIBLE_WINDOW
public static final int FLAG_SYSTEM_ERROR
public int flags
FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
,
FLAG_DIM_BEHIND
,
FLAG_NOT_FOCUSABLE
,
FLAG_NOT_TOUCHABLE
,
FLAG_NOT_TOUCH_MODAL
,
FLAG_TOUCHABLE_WHEN_WAKING
,
FLAG_KEEP_SCREEN_ON
,
FLAG_LAYOUT_IN_SCREEN
,
FLAG_LAYOUT_NO_LIMITS
,
FLAG_FULLSCREEN
,
FLAG_FORCE_NOT_FULLSCREEN
,
FLAG_SECURE
,
FLAG_SCALED
,
FLAG_IGNORE_CHEEK_PRESSES
,
FLAG_LAYOUT_INSET_DECOR
,
FLAG_ALT_FOCUSABLE_IM
,
FLAG_WATCH_OUTSIDE_TOUCH
,
FLAG_SHOW_WHEN_LOCKED
,
FLAG_SHOW_WALLPAPER
,
FLAG_TURN_SCREEN_ON
,
FLAG_DISMISS_KEYGUARD
,
FLAG_SPLIT_TOUCH
,
FLAG_HARDWARE_ACCELERATED
public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED
FLAG_HARDWARE_ACCELERATED
except for trusted system windows
that need hardware acceleration (e.g. LockScreen), where hardware acceleration
is generally disabled. This flag must be specified in addition to
FLAG_HARDWARE_ACCELERATED
to enable hardware acceleration for system
windows.public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED
public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS
WallpaperService.Engine.setOffsetNotificationsEnabled(boolean)
.public static final int PRIVATE_FLAG_SET_NEEDS_MENU_KEY
public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS
public int privateFlags
public static final int SOFT_INPUT_MASK_STATE
softInputMode
of the bits that determine the
desired visibility state of the soft input area for this window.public static final int SOFT_INPUT_STATE_UNSPECIFIED
softInputMode
: no state has been specified.public static final int SOFT_INPUT_STATE_UNCHANGED
softInputMode
: please don't change the state of
the soft input area.public static final int SOFT_INPUT_STATE_HIDDEN
softInputMode
: please hide any soft input
area when normally appropriate (when the user is navigating
forward to your window).public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN
softInputMode
: please always hide any
soft input area when this window receives focus.public static final int SOFT_INPUT_STATE_VISIBLE
softInputMode
: please show the soft
input area when normally appropriate (when the user is navigating
forward to your window).public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE
softInputMode
: please always make the
soft input area visible when this window receives input focus.public static final int SOFT_INPUT_MASK_ADJUST
softInputMode
of the bits that determine the
way that the window should be adjusted to accommodate the soft
input window.public static final int SOFT_INPUT_ADJUST_UNSPECIFIED
softInputMode
: nothing specified.
The system will try to pick one or
the other depending on the contents of the window.public static final int SOFT_INPUT_ADJUST_RESIZE
softInputMode
: set to allow the
window to be resized when an input
method is shown, so that its contents are not covered by the input
method. This can not be combined with
SOFT_INPUT_ADJUST_PAN
; if
neither of these are set, then the system will try to pick one or
the other depending on the contents of the window.public static final int SOFT_INPUT_ADJUST_PAN
softInputMode
: set to have a window
pan when an input method is
shown, so it doesn't need to deal with resizing but just panned
by the framework to ensure the current input focus is visible. This
can not be combined with SOFT_INPUT_ADJUST_RESIZE
; if
neither of these are set, then the system will try to pick one or
the other depending on the contents of the window.public static final int SOFT_INPUT_ADJUST_NOTHING
softInputMode
: set to have a window
not adjust for a shown input method. The window will not be resized,
and it will not be panned to make its focus visible.public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION
softInputMode
: set when the user has navigated
forward to the window. This is normally set automatically for
you by the system, though you may want to set it in certain cases
when you are displaying a window yourself. This flag will always
be cleared automatically after the window is displayed.public int softInputMode
SOFT_INPUT_STATE_UNSPECIFIED
, SOFT_INPUT_STATE_UNCHANGED
,
SOFT_INPUT_STATE_HIDDEN
, SOFT_INPUT_STATE_ALWAYS_VISIBLE
, or
SOFT_INPUT_STATE_VISIBLE
.
SOFT_INPUT_ADJUST_UNSPECIFIED
,
SOFT_INPUT_ADJUST_RESIZE
, or
SOFT_INPUT_ADJUST_PAN
.public int gravity
Gravity
. Both
Gravity.apply
and
Gravity.applyDisplay
are used during window layout, with this value
given as the desired gravity. For example you can specify
Gravity.DISPLAY_CLIP_HORIZONTAL
and
Gravity.DISPLAY_CLIP_VERTICAL
here
to control the behavior of
Gravity.applyDisplay
.Gravity
public float horizontalMargin
Gravity.apply
for how this is used. This
field is added with x
to supply the xAdj parameter.public float verticalMargin
Gravity.apply
for how this is used. This
field is added with y
to supply the yAdj parameter.public int format
PixelFormat
. Default is OPAQUE.public int windowAnimations
public float alpha
public float dimAmount
FLAG_DIM_BEHIND
is set, this is the amount of dimming
to apply. Range is from 1.0 for completely opaque to 0.0 for no
dim.public static final float BRIGHTNESS_OVERRIDE_NONE
screenBrightness
and buttonBrightness
indicating that the brightness value is not overridden for this window
and normal brightness policy should be used.public static final float BRIGHTNESS_OVERRIDE_OFF
screenBrightness
and buttonBrightness
indicating that the screen or button backlight brightness should be set
to the lowest value when this window is in front.public static final float BRIGHTNESS_OVERRIDE_FULL
screenBrightness
and buttonBrightness
indicating that the screen or button backlight brightness should be set
to the hightest value when this window is in front.public float screenBrightness
public float buttonBrightness
public IBinder token
public String packageName
public int screenOrientation
ActivityInfo.screenOrientation
.
If not set, a default value of
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
will be used.public int systemUiVisibility
public int subtreeSystemUiVisibility
public boolean hasSystemUiListeners
public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES
public static final int INPUT_FEATURE_NO_INPUT_CHANNEL
public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY
Should only be used by the keyguard and phone app.
public int inputFeatures
#INPUT_FEATURE_DISABLE_TOUCH_PAD_GESTURES
,
INPUT_FEATURE_NO_INPUT_CHANNEL
,
INPUT_FEATURE_DISABLE_USER_ACTIVITY
public long userActivityTimeout
This property can only be used to reduce the user specified display timeout; it can never make the timeout longer than it normally would be.
Should only be used by the keyguard and phone app.
public static final Parcelable.Creator<WindowManager.LayoutParams> CREATOR
public static final int LAYOUT_CHANGED
public static final int TYPE_CHANGED
public static final int FLAGS_CHANGED
public static final int FORMAT_CHANGED
public static final int ANIMATION_CHANGED
public static final int DIM_AMOUNT_CHANGED
public static final int TITLE_CHANGED
public static final int ALPHA_CHANGED
public static final int MEMORY_TYPE_CHANGED
public static final int SOFT_INPUT_MODE_CHANGED
public static final int SCREEN_ORIENTATION_CHANGED
public static final int SCREEN_BRIGHTNESS_CHANGED
public static final int BUTTON_BRIGHTNESS_CHANGED
public static final int SYSTEM_UI_VISIBILITY_CHANGED
public static final int SYSTEM_UI_LISTENER_CHANGED
public static final int INPUT_FEATURES_CHANGED
public static final int PRIVATE_FLAGS_CHANGED
public static final int USER_ACTIVITY_TIMEOUT_CHANGED
public static final int EVERYTHING_CHANGED
public WindowManager.LayoutParams()
public WindowManager.LayoutParams(int _type)
public WindowManager.LayoutParams(int _type, int _flags)
public WindowManager.LayoutParams(int _type, int _flags, int _format)
public WindowManager.LayoutParams(int w, int h, int _type, int _flags, int _format)
public WindowManager.LayoutParams(int w, int h, int xpos, int ypos, int _type, int _flags, int _format)
public WindowManager.LayoutParams(Parcel in)
public static boolean mayUseInputMethod(int flags)
FLAG_NOT_FOCUSABLE
and FLAG_ALT_FOCUSABLE_IM
flags and returns true if the combination of the two corresponds
to a window that needs to be behind the input method so that the
user can type into it.flags
- The current window manager flags.public final void setTitle(CharSequence title)
public final CharSequence getTitle()
public int describeContents()
Parcelable
describeContents
in interface Parcelable
public void writeToParcel(Parcel out, int parcelableFlags)
Parcelable
writeToParcel
in interface Parcelable
out
- The Parcel in which the object should be written.parcelableFlags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public final int copyFrom(WindowManager.LayoutParams o)
public String debug(String output)
ViewGroup.LayoutParams
debug
in class ViewGroup.LayoutParams
output
- the String to prepend to the internal representationpublic String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public void scale(float scale)