我的Android进阶之旅------>WindowManager.LayoutParams介绍
本文转载于:
http://hubingforever.blog.163.com/blog/static/171040579201175111031938/
本文参照自:
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html
http://blog.sina.com.cn/s/blog_4b3c1f950100qd9s.html
WindowManager.LayoutParams
extends ViewGroup.LayoutParams
implements Parcelable
java.lang.Object | ||
? | android.view.ViewGroup.LayoutParams | |
|
? | android.view.WindowManager.LayoutParams |
WindowManager.LayoutParams 是 WindowManager 接口的嵌套类;它继承于 ViewGroup.LayoutParams; 它用于向WindowManager描述Window的管理策略。
int | FLAGS_CHANGED | 用于表示flags发生了变化,关于此的详细内容请看后文。 |
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. 当该window对用户可见的时候,允许锁屏。 |
int | FLAG_ALT_FOCUSABLE_IM |
Window flag: invert the state of FLAG_NOT_FOCUSABLE withrespect to how this window interacts with the current method. |
int | FLAG_BLUR_BEHIND |
Window flag: blur everything behind this window. 让该window后所有东西都模糊(blur) |
int | FLAG_DIM_BEHIND |
Window flag: everything behind this window will be dimmed. 让该window后所有的东西都成暗淡(dim) |
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. |
int | FLAG_DITHER |
Window flag: turn on dithering when compositing this window to the screen. 开启抖动(dithering) |
int | FLAG_FORCE_NOT_FULLSCREEN |
Window flag: Override {@link #FLAG_FULLSCREEN and force the screen decorations (such as status bar) to be shown. 恢复window非全屏显示 |
int | FLAG_FULLSCREEN |
Window flag: Hide all screen decorations (e.g. 让window进行全屏显示 |
int | FLAG_HARDWARE_ACCELERATED |
Indicates whether this window should be hardware accelerated. 对该window进行硬件加速. 该flag必须在设置你的Activity或Dialog的Content View之前进行设置, 而且如果你在mainfest文件中用android:hardwareAccelerated开启了该属性的话,那么你在程序中就不能再改变它。mainfest文件中android:hardwareAccelerated属性默认是开启的("true")。 |
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. |
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. 当该window对用户可见时,让设备屏幕处于高亮(bright)状态。 |
int | FLAG_LAYOUT_INSET_DECOR |
Window flag: a special option only for use in combination with FLAG_LAYOUT_IN_SCREEN . |
int | FLAG_LAYOUT_IN_SCREEN |
Window flag: place the window within the entire screen, ignoring decorations around the border (a.k.a. 让window占满整个手机屏幕,不留任何边界(border) |
int | FLAG_LAYOUT_NO_LIMITS |
Window flag: allow window to extend outside of the screen. window大小不再不受手机屏幕大小限制,即window可能超出屏幕之外,这时部分内容在屏幕之外。 |
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. 让window不能获得焦点,这样用户快就不能向该window发送按键事件及按钮事件 |
int | FLAG_NOT_TOUCHABLE |
Window flag: this window can never receive touch events. 让该window不接受触摸屏事件 |
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. 即使在该window在可获得焦点情况下,仍然把该window之外的任何event发送到该window之后的其他window. |
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. |
int | FLAG_SECURE |
Window flag: don't allow screen shots while this window is displayed. 当该window在进行显示的时候,不允许截屏。 |
int | FLAG_SHOW_WALLPAPER |
Window flag: ask that the system wallpaper be shown behind your window. 在该window后显示系统的墙纸(wallpaper) |
int | FLAG_SHOW_WHEN_LOCKED |
Window flag: special flag to let windows be shown when the screen is locked. 当锁屏的时候,显示该window. |
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. When this flag is not set, the first pointer that goes down determines the window to which all subsequent touches go until all pointers go up. When this flag is set, each pointer (not necessarily the first) that goes down determines the window to which all subsequent touches of that pointer will go until that pointer goes up thereby enabling touches with multiple pointers to be split across multiple windows 当该window在可以接受触摸屏情况下,让因在该window之外,而发送到后面的window的触摸屏可以支持split touch. |
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. 当手机处于睡眠状态时,如果屏幕被按下,那么该window将第一个收到到事件 |
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. 当然window被显示的时候,系统将把它当做一个用户活动事件,以点亮手机屏幕。 |
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. 如果你设置了该flag,那么在你FLAG_NOT_TOUNCH_MODAL的情况下,即使触摸屏事件发送在该window之外,其事件被发送到了后面的window,那么该window仍然将以MotionEvent.ACTION_OUTSIDE形式收到该触摸屏事件 |
int | SOFT_INPUT_ADJUST_NOTHING |
Adjustment option for softInputMode :set to have a window not adjust for a shown input method. 当显示软键盘时,不调整window的布局 |
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. 当显示软键盘时,调整window的空白区域来显示软键盘。即使调整空白区域,软键盘还是有可能遮挡一些有内容区域,这时用户就只有退出软键盘才能看到这些被遮挡区域并进行交互。 |
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. 当显示软键盘时,调整window内的控件大小以便显示软键盘。这样的话控件可能会变形。 |
int | SOFT_INPUT_ADJUST_UNSPECIFIED |
Adjustment option for softInputMode :nothing specified. 不指定显示软件盘时,window的调整方式。 |
int | SOFT_INPUT_IS_FORWARD_NAVIGATION |
Bit for softInputMode :set when the user has navigated forward to the window. 表示用户导航(navigate)到了你的window |
int | SOFT_INPUT_MASK_ADJUST |
Mask for softInputMode ofthe bits that determine the way that the window should be adjusted to accommodate the soft input window. 显示软键盘时,用于表示window调整方式的bite的mask。 显示软键盘时的window调整方式可以是SOFT_INPUT_ADJUST_NOTHING,SOFT_INPUT_ADJUST_PAN,SOFT_INPUT_ADJUST_RESIZE,SOFT_INPUT_ADJUST_UNSPECIFIED。 用于描述软键盘显示的规则可以是SOFT_INPUT_STATE_ALWAYS_HIDDEN,SOFT_INPUT_STATE_ALWAYS_VISIBLE, SOFT_INPUT_STATE_HIDDEN,SOFT_INPUT_STATE_VISIBLE,SOFT_INPUT_STATE_UNSPECIFIED之一 |
int | SOFT_INPUT_MASK_STATE |
Mask for softInputMode ofthe bits that determine the desired visibility state of the soft input area for this window. 用于描述软键盘显示规则的bite的mask. |
int | SOFT_INPUT_MODE_CHANGED | 用于表示softInputMode发生了变化。关于此的详细内容请看后文。 |
int | SOFT_INPUT_STATE_ALWAYS_HIDDEN |
Visibility state for softInputMode :please always hide any soft input area when this window receives focus. 总是隐藏软键盘。 |
int | SOFT_INPUT_STATE_ALWAYS_VISIBLE |
Visibility state for softInputMode :please always make the soft input area visible when this window receives input focus. 总是显示软键盘 |
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). 用户导航(navigate)到你的窗口的时候,隐藏软键盘 |
int | SOFT_INPUT_STATE_UNCHANGED |
Visibility state for softInputMode :please don't change the state of the soft input area. |
int | SOFT_INPUT_STATE_UNSPECIFIED |
Visibility state for softInputMode :no state has been specified. 没有软键盘显示的约定规则 |
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). 用户导航(navigate)到你的窗口的时候,显示软键盘 |
int | TYPE_APPLICATION |
Window type: a normal application window. 普通的应用程序window,token必须设置为Activity的token,以指出该窗口属谁 |
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. 对话框。类似于面板窗口,绘制类似于顶层窗口,而不是宿主的子窗口。 |
int | TYPE_APPLICATION_MEDIA |
Window type: window for showing media (e.g. 媒体窗口,例如视频。显示于宿主窗口下层。 |
int | TYPE_APPLICATION_PANEL |
Window type: a panel on top of an application window. 面板窗口,显示于宿主窗口上层 |
int | TYPE_APPLICATION_STARTING |
Window type: special application window that is displayed while the application is starting. 用于应用程序启动时所显示的窗口。应用本身不要使用这种类型。它用于让系统显示些信息,直到应用程序可以开启自己的窗口 |
int | TYPE_APPLICATION_SUB_PANEL |
Window type: a sub-panel on top of an application window. 应用程序窗口的子面板。显示于所有面板窗口的上层。(GUI的一般规律,越“子”越靠上) |
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. 所有程序窗口的“基地”窗口,其他应用程序窗口都显示在它上面。 |
int | TYPE_CHANGED | 表示window的类型发生了变化,关于此的详细内容请看后文。 |
int | TYPE_INPUT_METHOD |
Window type: internal input methods windows, which appear above the normal UI. 内部输入法窗口,显示于普通UI之上。应用程序可重新布局以免被此窗口覆盖 |
int | TYPE_INPUT_METHOD_DIALOG |
Window type: internal input methods dialog windows, which appear above the current input method window. 内部输入法对话框,显示于当前输入法窗口之上 |
int | TYPE_KEYGUARD |
Window type: keyguard window. 锁屏窗口 |
int | TYPE_KEYGUARD_DIALOG |
Window type: dialogs that the keyguard shows 锁屏时显示的对话框 |
int | TYPE_PHONE |
Window type: phone. 电话窗口。它用于电话交互(特别是呼入)。它置于所有应用程序之上,状态栏之下。 |
int | TYPE_PRIORITY_PHONE |
Window type: priority phone UI, which needs to be displayed even if the keyguard is active. 电话优先,当锁屏时显示。此窗口不能获得输入焦点,否则影响锁屏。 |
int | TYPE_SEARCH_BAR |
Window type: the search bar. 搜索栏。只能有一个搜索栏;它位于屏幕上方。 |
int | TYPE_STATUS_BAR |
Window type: the status bar. 状态栏类型的window。只能有一个状态栏window;它位于屏幕顶端,其他窗口都位于它下方。 |
int | TYPE_STATUS_BAR_PANEL |
Window type: panel that slides out from over the status bar 状态栏的滑动面板 |
int | TYPE_SYSTEM_ALERT |
Window type: system window, such as low power alert. 系统提示window,比如电池低的警告。它总是出现在应用程序窗口之上。 |
int | TYPE_SYSTEM_DIALOG |
Window type: panel that slides out from the status bar 系统对话框。(例如音量调节框) |
int | TYPE_SYSTEM_ERROR |
Window type: internal system error windows, appear on top of everything they can. 系统内部错误提示,显示于所有内容之上 |
int | TYPE_SYSTEM_OVERLAY |
Window type: system overlay windows, which need to be displayed on top of everything else. 系统顶层窗口。显示在其他一切内容之上。此窗口不能获得输入焦点,否则影响锁屏。 |
int | TYPE_TOAST |
Window type: transient notifications. toast类型的window |
int | TYPE_WALLPAPER |
Window type: wallpaper window, placed behind any window that wants to sit on top of the wallpaper. 用于墙纸的window |
(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).
(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.
(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.
int | FIRST_APPLICATION_WINDOW |
Start of window types that represent normal application windows. Constant Value: 1 (0x00000001) |
int | FIRST_SUB_WINDOW |
Start of types of sub-windows. Constant Value: 1000 (0x000003e8) |
int | FIRST_SYSTEM_WINDOW |
Start of system-specific window types. Constant Value: 2000 (0x000007d0) |
int | LAST_APPLICATION_WINDOW |
End of types of application windows. Constant Value: 99 (0x00000063) |
int | LAST_SUB_WINDOW |
End of types of sub-windows. Constant Value: 1999 (0x000007cf) |
int | LAST_SYSTEM_WINDOW |
End of types of system windows.
Constant Value: 2999 (0x00000bb7) |
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. 把brightness(screenBrightness/buttonBrightness)设置到最高值。 |
float | BRIGHTNESS_OVERRIDE_NONE |
Default value for screenBrightness and buttonBrightness indicatingthat the brightness value is not overridden for this window and normal brightness policy should be used. 不对brightness(screenBrightness/buttonBrightness)重新进行设置,采用默认的普通值。 |
float | BRIGHTNESS_OVERRIDE_OFF |
Value for screenBrightness and buttonBrightness indicatingthat the screen or button backlight brightness should be set to the lowest value when this window is in front. 把brightness(screenBrightness/buttonBrightness)设置到最低值。 |
int | ALPHA_CHANGED | 用于表示成员变量alpha是否被改变 |
int | ANIMATION_CHANGED | 用于表示成员变量windowAnimations是否被改变 |
int | DIM_AMOUNT_CHANGED | 用于表示成员变量dimAmount是否被改变 |
int | FLAGS_CHANGED | 用于表示成员变量flags是否被改变 |
int | LAYOUT_CHANGED |
用于表示layout是否被改变.这里的layout是指以下变量所包含的信息: width,height,x,y, verticalMargin,verticalWeight,horizontalMargin,horizontalWeight |
int | SCREEN_BRIGHTNESS_CHANGED |
用于表示brightness是否被改变. 这里的brightness是指以下变量对应的信息:screenBrightness,buttonBrightness |
int | SCREEN_ORIENTATION_CHANGED | 用于表示成员变量screenOrientation是否被改变 |
int | SOFT_INPUT_MODE_CHANGED | 用于表示成员变量softInputMode是否被改变 |
int | TITLE_CHANGED | 用于表示成员变量title是否被改变 |
int | TYPE_CHANGED | 用于表示成员变量type是否被改变 |
int | FORMAT_CHANGED |
Constant Value: (0x00000008) 用于表示成员变量format是否被改变 |
public int | height | Information about how tall the view wants to be. |
public LayoutAnimationController.AnimationParameters | layoutAnimationParameters | Used to animate layouts. |
public int | width | Information about how wide the view wants to be. |
public static final Creator<WindowManager.LayoutParams> | CREATOR |
|
public float | alpha | An alpha value to apply to this entire window. |
public float | buttonBrightness | This can be used to override the standard behavior of the button and keyboard backlights. |
public float | dimAmount |
When FLAG_DIM_BEHIND isset, this is the amount of dimming to apply. |
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 float | horizontalWeight | Indicates how much of the extra space will be allocated horizontally to the view associated with these LayoutParams. |
public int | memoryType | This field is deprecated. this is ignored |
public String | packageName | Name of the package owning this window. |
public float | screenBrightness | This can be used to override the user's preferred brightness of the screen. |
public int | screenOrientation | Specific orientation value for a window. |
public int | softInputMode | Desired operating mode for any soft input area. |
public int | systemUiVisibility | Control the visibility of the status bar. |
public IBinder | token | Identifier for this window. |
public int | type | The general type of window. |
public float | verticalMargin | The vertical margin, as a percentage of the container's height, between the container and the widget. |
public float | verticalWeight | Indicates how much of the extra space will be allocated vertically to the view associated with these LayoutParams. |
public int | windowAnimations | A style resource defining the animations to use for this window. |
public int | x | X position for this window. |
public int | y | Y position for this window. |
ublic Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
final 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.
|
||||||||||
final 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.
|
||||||||||
final 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.
|
我的Android进阶之旅------>WindowManager.LayoutParams介绍的更多相关文章
- [置顶] 我的Android进阶之旅------>介绍一款集录制与剪辑为一体的屏幕GIF 动画制作工具 GifCam
由于上一篇文章:我的Android进阶之旅------>Android之动画之Frame Animation实例 中展示的是Frame动画效果,但是之前我是将图片截取下来,不好说明确切的动画过程 ...
- 我的Android进阶之旅------> Android在TextView中显示图片方法
面试题:请说出Android SDK支持哪些方式显示富文本信息(不同颜色.大小.并包括图像的文本信息).并简要说明实现方法. 答案:Android SDK支持例如以下显示富文本信息的方式. 1.使用T ...
- 【我的Android进阶之旅】推荐一款视频转换GIF图片格式的转换工具(Video to GIF)
一.背景 最近想把一些Android Demo的运行效果图获取下来,但是一直使用真机进行调试,在电脑上不好截取一段gif动画.而之前使用模拟器的时候可以使用 GifCam 工具进行屏幕动画截取.Gif ...
- 我的Android进阶之旅------>Android字符串资源中的单引號问题error: Apostrophe not preceded by 的解决的方法
刚刚在string字符串资源文件里,写了一个单引號.报错了,错误代码例如以下 error: Apostrophe not preceded by \ (in OuyangPeng's blog ) 资 ...
- 我的Android进阶之旅------>Android颜色值(#AARRGGBB)透明度百分比和十六进制对应关系以及计算方法
我的Android进阶之旅-->Android颜色值(RGB)所支持的四种常见形式 透明度百分比和十六进制对应关系表格 透明度 十六进制 100% FF 99% FC 98% FA 97% F7 ...
- 我的Android进阶之旅------>解决Jackson等第三方转换Json的开发包在开启混淆后转换的实体类数据都是null的bug
1.错误描述 今天测试人员提了一个bug,说使用我们的app出现了闪退的bug,后来通过debug断点调试,发现我们的app转换服务器发送过来的json数据后,都是为null.而之前已经提测快一个月的 ...
- 我的Android进阶之旅------>关于android:layout_weight属性的详细解析
关于androidlayout_weight属性的详细解析 效果一 效果二 图3的布局代码 图4的布局代码 效果三 图7代码 图8代码 效果四 效果五 版权声明:本文为[欧阳鹏]原创文章,欢迎转载,转 ...
- 我的Android进阶之旅------>如何解决Android 5.0中出现的警告: Service Intent must be explicit:
我的Android进阶之旅-->如何解决Android 5.0中出现的警告: java.lang.IllegalArgumentException: Service Intent must be ...
- 我的Android进阶之旅------>Java字符串格式化方法String.format()格式化float型时小数点变成逗号问题
今天接到一个波兰的客户说有个APP在英文状态下一切运行正常,但是当系统语言切换到波兰语言的时候,程序奔溃了.好吧,又是我来维护. 好吧,先把系统语言切换到波兰语,切换到波兰语的方法查看文章 我的And ...
随机推荐
- AForge.NET Framework-2.2.5
http://www.aforgenet.com/framework/downloads.html AForge.NET Framework-2.2.5 简介 AForge.NET是一个专门为开发者和 ...
- iOS 引入外部字体 otf/ttf/ttc
1.首先下载到字体的otf文件(Mac电脑下搜索字体册) 2.将字体文件拖到项目工程下 3.plist设置 Fonts provided by application 属性 4.代码中使用[UIFon ...
- Beautiful Soup 4.4.0 基本使用方法
Beautiful Soup 4.4.0 基本使用方法Beautiful Soup 安装 pip install beautifulsoup4 标准库有html.parser解析器但速度不是很快一般 ...
- Linux——环境变量的文件及配置
环境变量是包含关于系统及当前登录用户的环境信息的字符串,一些软件程序使用此信息确定在何处放置文件(如临时文件). 一.环境变量文件介绍 转自:http://blog.csdn.net/cscmaker ...
- mongoDB 高级查询语法
http://www.cnblogs.com/ITAres/articles/2084794.html本文参考自官方的手册:http://www.mongodb.org/display/DOCS/Ad ...
- Python--多进程--01
multiprocess import multiprocessing import time def worker_1(interval): print(' i am worker1') n=5 w ...
- Android各种模拟器使用笔记
[√]天天模拟器 优点: 缺点: 个人经验 ADB 版本过低的解决办法 去启动时的广告方法 去除多余进程方法 ADB无法连接到模拟器 原因分析: 解决方案: 安装APP(APK)时非常非常慢TTMNQ ...
- ACM算法整理(不断补充ing)
动态规划 1.背包问题 (1)01背包 ,n) DFR(v,V,C[i]) F[v]=max(F[v],F[v-C[i]]+W[i]); } //初始化时 //若背包不一定装满F全初始化为0 //若装 ...
- Creating External Table - KUP-04020
原因:因为操作系统环境不同,所以换行符也不同,要查看数据文件的换行符 解决方法: 1.如果是苹果系统类的数据文件,则改为:RECORDS DELIMITED BY 0X'0D' 2.如果是window ...
- Redis学习笔记-Redis内部数据结构
Redis内部数据结构 Redis和其他key-value数据库的很大区别是它支持非字符串类型的value值.它支持的value值的类型如下: sds (simple dynamic string) ...