Reference:Android.view.WindowManager.LayoutParams

From Triled Wiki

Jump to: navigation, search


android.view
public static class android.view.WindowManager.LayoutParams

java.lang.Object
android.view.ViewGroup.LayoutParams
android.view.WindowManager.LayoutParams Parcelable

[edit] Summary


[edit] XML Attributes inherited from class android.view.ViewGroup.LayoutParams

android:layout_height, android:layout_width

[edit] Constants

      Value  
int  ALPHA_CHANGED     128  0x00000080 
int  ANIMATION_CHANGED     16  0x00000010 
int  BLUR_TINT_CHANGED     32  0x00000020 
Creator   CREATOR        
int  FIRST_APPLICATION_WINDOW   Start of window types that represent normal application windows.   0x00000001 
int  FIRST_SUB_WINDOW   Start of types of sub-windows.   1000  0x000003e8 
int  FIRST_SYSTEM_WINDOW   Start of system-specific window types.   2000  0x000007d0 
int  FLAGS_CHANGED     0x00000004 
int  FLAG_BLUR_BEHIND   Window flag: blur everything behind this window.   0x00000004 
int  FLAG_DITHER   Window flag: turn on dithering when compositing this window to the screen.   2048  0x00000800 
int  FLAG_FORCE_STATUS_BAR   Window flag: Override NO_STATUS_BAR_FLAG and force the status bar to be shown.   1024  0x00000400 
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.   128  0x00000080 
int  FLAG_LAYOUT_IN_SCREEN   Window flag: place the window within the entire screen, ignoring decorations around the border (a.k.a.   256  0x00000100 
int  FLAG_NOT_FOCUSABLE   Window flag: this window won't ever get focus.   0x00000008 
int  FLAG_NOT_TOUCHABLE   Window flag: this window can never receive touch events.   16  0x00000010 
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.   32  0x00000020 
int  FLAG_NO_STATUS_BAR   Window flag: Ignore all decorations (e.g.   512  0x00000200 
int  FLAG_ORIENTATION_DEFAULT   Window flag: Force the display to the user's current orientation setting, regardless of the windows behind it.   12288  0x00003000 
int  FLAG_ORIENTATION_LANDSCAPE   Window flag: The display must be in a landscape orientation when this window is at the top.   8192  0x00002000 
int  FLAG_ORIENTATION_PORTRAIT   Window flag: The display must be in a portrait orientation when this window is at the top.   4096  0x00001000 
int  FLAG_PAGE_ALIGNED   Window flag: The surface is aligned on a page boundary.   0x00000001 
int  FLAG_TINT_BEHIND   Window flag: tint everything behind this window.   0x00000002 
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.   64  0x00000040 
int  FORMAT_CHANGED     0x00000008 
int  LAST_APPLICATION_WINDOW   End of types of application windows.   99  0x00000063 
int  LAST_SUB_WINDOW   End of types of sub-windows.   1999  0x000007cf 
int  LAST_SYSTEM_WINDOW   End of types of system windows.   2999  0x00000bb7 
int  LAYOUT_CHANGED     0x00000001 
int  TITLE_CHANGED     64  0x00000040 
int  TYPE_APPLICATION   Window type: a normal application window.   0x00000002 
int  TYPE_APPLICATION_MEDIA   Window type: window for showing media (e.g.   1001  0x000003e9 
int  TYPE_APPLICATION_PANEL   Window type: a panel on top of an application window.   1000  0x000003e8 
int  TYPE_APPLICATION_STARTING   Window type: special application window that is displayed while the application is starting.   0x00000003 
int  TYPE_APPLICATION_SUB_PANEL   Window type: a sub-panel on top of an application window.   1002  0x000003ea 
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.   0x00000001 
int  TYPE_CHANGED     0x00000002 
int  TYPE_KEYGUARD   Window type: keyguard window.   2004  0x000007d4 
int  TYPE_NOTIFICATION   Window type: transient notifications.   2005  0x000007d5 
int  TYPE_PHONE   Window type: phone.   2002  0x000007d2 
int  TYPE_PRIORITY_PHONE   Window type: priority phone UI, which needs to be displayed even if the keyguard is active.   2007  0x000007d7 
int  TYPE_SEARCH_BAR   Window type: the search bar.   2001  0x000007d1 
int  TYPE_STATUS_BAR   Window type: the status bar.   2000  0x000007d0 
int  TYPE_SYSTEM_ALERT   Window type: system window, such as low power alert.   2003  0x000007d3 
int  TYPE_SYSTEM_OVERLAY   Window type: system overlay windows, which need to be displayed on top of everything else.   2006  0x000007d6 

[edit] Constants inherited from class android.view.ViewGroup.LayoutParams

FILL_PARENT, WRAP_CONTENT

[edit] Fields

public      float  alpha   An alpha value to apply to this entire window.  
public      int  animation   A style resource defining the animations to use for this window.  
public      int  flags   Various behavioral options/flags.  
public      int  format   The desired bitmap format.  
public      int  gravity   Placement of window within the screen as per Gravity  
public      float  horizontalMargin   The horizontal margin, as a percentage of the container's width, between the container and the widget.  
public      int  tintBehind   A tint to apply to the windows behind when FLAG_TINT_BEHIND or FLAG_BLUR_BEHIND is set.  
public      IBinder   token   Identifier for this window.  
public      int  type   The general type of window.  
public      float  verticalMargin   The horizontal margin, as a percentage of the container's width, between the container and the widget.  
public      int  x   X position for this window.  
public      int  y   Y position for this window.  

[edit] Fields inherited from class android.view.ViewGroup.LayoutParams

height, layoutAnimationParameters, width

[edit] Public Constructors

          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)

[edit] Public Methods

    final    int  copyFrom (LayoutParams o)
        String   debug (String output)
Returns a String representation of this set of layout parameters.
    final    CharSequence   getTitle ()
    final    void  setTitle (CharSequence title)
        String   toString ()
Answers a string containing a concise, human-readable description of the receiver.
        void  writeToParcel (Parcel out)

[edit] Methods inherited from class android.view.ViewGroup.LayoutParams
setBaseAttributes
[edit] Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
[edit] Methods inherited from interface android.os.Parcelable

writeToParcel

[edit] Details

[edit] Constants

[edit] public static final int ALPHA_CHANGED

Constant Value: 128 (0x00000080)

[edit] public static final int ANIMATION_CHANGED

Constant Value: 16 (0x00000010)

[edit] public static final int BLUR_TINT_CHANGED

Constant Value: 32 (0x00000020)

[edit] public static final Creator CREATOR

[edit] public static final int FIRST_APPLICATION_WINDOW

Start of window types that represent normal application windows. Constant Value: 1 (0x00000001)

[edit] public static final int FIRST_SUB_WINDOW

Start of types of sub-windows. The 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. Constant Value: 1000 (0x000003e8)

[edit] public static final int FIRST_SYSTEM_WINDOW

Start of system-specific window types. These are not normally created by applications. Constant Value: 2000 (0x000007d0)

[edit] public static final int FLAGS_CHANGED

Constant Value: 4 (0x00000004)

[edit] public static final int FLAG_BLUR_BEHIND

Window flag: blur everything behind this window. Setting this also implies FLAG_TINT_BEHIND. Constant Value: 4 (0x00000004)

[edit] public static final int FLAG_DITHER

Window flag: turn on dithering when compositing this window to the screen. Constant Value: 2048 (0x00000800)

[edit] public static final int FLAG_FORCE_STATUS_BAR

Window flag: Override NO_STATUS_BAR_FLAG and force the status bar to be shown. Constant Value: 1024 (0x00000400)

[edit] public static final 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. Constant Value: 128 (0x00000080)

[edit] public static final int FLAG_LAYOUT_IN_SCREEN

Window flag: place the window within the entire screen, ignoring decorations around the border (a.k.a. the status bar). The window must correctly position its contents to take the screen decoration into account. Constant Value: 256 (0x00000100)

[edit] public static final int FLAG_NOT_FOCUSABLE

Window flag: this window won't ever get focus. Constant Value: 8 (0x00000008)

[edit] public static final int FLAG_NOT_TOUCHABLE

Window flag: this window can never receive touch events. Constant Value: 16 (0x00000010)

[edit] public static final 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. Otherwise it will consume all pointer events itself, regardless of whether they are inside of the window. Constant Value: 32 (0x00000020)

[edit] public static final int FLAG_NO_STATUS_BAR

Window flag: Ignore all decorations (e.g. status bar) for layout purposes. Clients setting this flag should either accommodate the decorations in their layout or make sure that they are not visible. The status bar will be hidden when an app window with this flag set is on the top layer. Constant Value: 512 (0x00000200)

[edit] public static final int FLAG_ORIENTATION_DEFAULT

Window flag: Force the display to the user's current orientation setting, regardless of the windows behind it. This is for use in dialog windows, which normally follow the orientation of the window behind them; setting this flag causes the dialog to force the display back to the user's orientation, ignoring the orientation preference of the windows behind it. Constant Value: 12288 (0x00003000)

[edit] public static final int FLAG_ORIENTATION_LANDSCAPE

Window flag: The display must be in a landscape orientation when this window is at the top. Constant Value: 8192 (0x00002000)

[edit] public static final int FLAG_ORIENTATION_PORTRAIT

Window flag: The display must be in a portrait orientation when this window is at the top. Constant Value: 4096 (0x00001000)

[edit] public static final int FLAG_PAGE_ALIGNED

Window flag: The surface is aligned on a page boundary. Constant Value: 1 (0x00000001)

[edit] public static final int FLAG_TINT_BEHIND

Window flag: tint everything behind this window. Use tintBehind to define the tint color. Constant Value: 2 (0x00000002)

[edit] public static final 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. Usually the first touch event is consumed by the system since the user can not see what they are pressing on. Constant Value: 64 (0x00000040)

[edit] public static final int FORMAT_CHANGED

Constant Value: 8 (0x00000008)

[edit] public static final int LAST_APPLICATION_WINDOW

End of types of application windows. Constant Value: 99 (0x00000063)

[edit] public static final int LAST_SUB_WINDOW

End of types of sub-windows. Constant Value: 1999 (0x000007cf)

[edit] public static final int LAST_SYSTEM_WINDOW

End of types of system windows. Constant Value: 2999 (0x00000bb7)

[edit] public static final int LAYOUT_CHANGED

Constant Value: 1 (0x00000001)

[edit] public static final int TITLE_CHANGED

Constant Value: 64 (0x00000040)

[edit] public static final int TYPE_APPLICATION

Window type: a normal application window. The token must be an Activity token identifying who the window belongs to. Constant Value: 2 (0x00000002)

[edit] public static final int TYPE_APPLICATION_MEDIA

Window type: window for showing media (e.g. video). These windows are displayed behind their attached window. Constant Value: 1001 (0x000003e9)

[edit] public static final int TYPE_APPLICATION_PANEL

Window type: a panel on top of an application window. These windows appear on top of their attached window. Constant Value: 1000 (0x000003e8)

[edit] public static final int TYPE_APPLICATION_STARTING

Window type: special application window that is displayed while the application is starting. Not for use by applications themselves; this is used by the system to display something until the application can show its own windows. Constant Value: 3 (0x00000003)

[edit] public static final int TYPE_APPLICATION_SUB_PANEL

Window type: a sub-panel on top of an application window. These windows are displayed on top their attached window and any TYPE_APPLICATION_PANEL panels. Constant Value: 1002 (0x000003ea)

[edit] public static final 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. Constant Value: 1 (0x00000001)

[edit] public static final int TYPE_CHANGED

Constant Value: 2 (0x00000002)

[edit] public static final int TYPE_KEYGUARD

Window type: keyguard window. Constant Value: 2004 (0x000007d4)

[edit] public static final int TYPE_NOTIFICATION

Window type: transient notifications. Constant Value: 2005 (0x000007d5)

[edit] public static final int TYPE_PHONE

Window type: phone. These are non-application windows providing user interaction with the phone (in particular incoming calls). These windows are normally placed above all applications, but behind the status bar. Constant Value: 2002 (0x000007d2)

[edit] public static final int TYPE_PRIORITY_PHONE

Window type: priority phone UI, which needs to be displayed even if the keyguard is active. These windows must not take input focus, or they will interfere with the keyguard. Constant Value: 2007 (0x000007d7)

[edit] public static final int TYPE_SEARCH_BAR

Window type: the search bar. There can be only one search bar window; it is placed at the top of the screen. Constant Value: 2001 (0x000007d1)

[edit] public static final int TYPE_STATUS_BAR

Window type: the status bar. There can be only one status bar window; it is placed at the top of the screen, and all other windows are shifted down so they are below it. Constant Value: 2000 (0x000007d0)

[edit] public static final int TYPE_SYSTEM_ALERT

Window type: system window, such as low power alert. These windows are always on top of application windows. Constant Value: 2003 (0x000007d3)

[edit] public static final int TYPE_SYSTEM_OVERLAY

Window type: system overlay windows, which need to be displayed on top of everything else. These windows must not take input focus, or they will interfere with the keyguard. Constant Value: 2006 (0x000007d6)

[edit] Fields

[edit] public float alpha

An alpha value to apply to this entire window. An alpha of 1.0 means fully opaque and 0.0 means fully transparent

[edit] public int animation

A style resource defining the animations to use for this window. This must be a system resource; it can not be an application resource because the window manager does not have access to applications.

[edit] public int flags

Various behavioral options/flags. Default is none.

See Also

[edit] public int format

The desired bitmap format. May be one of the constants in PixelFormat. Default is OPAQUE.

[edit] public int gravity

Placement of window within the screen as per Gravity

See Also

[edit] public float horizontalMargin

The horizontal margin, as a percentage of the container's width, between the container and the widget.

[edit] public int tintBehind

A tint to apply to the windows behind when FLAG_TINT_BEHIND or FLAG_BLUR_BEHIND is set. This an ARGB value of the form 0xaarrggbb; an alpha of 0 will apply no tint.

[edit] public IBinder token

Identifier for this window. This will usually be filled in for you.

[edit] public int type

The general type of window. There are three main classes of window types:

  • Application windows (ranging from 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).
  • Sub-windows (ranging from 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.
  • System windows (ranging from 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.

See Also

[edit] public float verticalMargin

The horizontal margin, as a percentage of the container's width, between the container and the widget.

[edit] public int x

X position for this window. With the default gravity it is ignored. When using LEFT or RIGHT it provides an offset from the given edge.

[edit] public int y

Y position for this window. With the default gravity it is ignored. When using TOP or BOTTOM it provides an offset from the given edge.

[edit] Public Constructors

[edit] public WindowManager.LayoutParams()

[edit] public WindowManager.LayoutParams(int _type)

[edit] public WindowManager.LayoutParams(int _type, int _flags)

[edit] public WindowManager.LayoutParams(int _type, int _flags, int _format)

[edit] public WindowManager.LayoutParams(int w, int h, int _type, int _flags, int _format)

[edit] public WindowManager.LayoutParams(int w, int h, int xpos, int ypos, int _type, int _flags, int _format)

[edit] public WindowManager.LayoutParams(Parcel in)

[edit] Public Methods

[edit] public final int copyFrom(LayoutParams o)

[edit] public String debug(String output)

Returns a String representation of this set of layout parameters.

Parameters

output the String to prepend to the internal representation

[edit] public final CharSequence getTitle()

[edit] public final void setTitle(CharSequence title)

[edit] public String toString()

Answers a string containing a concise, human-readable description of the receiver.

[edit] public void writeToParcel(Parcel out)

[edit] References

Personal tools