现在的位置: 首页 > 综合 > 正文

WindowManager.LayoutParams(下)

2013年04月06日 ⁄ 综合 ⁄ 共 2411字 ⁄ 字号 评论关闭

本文参照自:http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html

BRIGHTNESS系列
该系列主要用于设置window的brightness(screenBrightness/buttonBrightness)我们可以通过WindowManager.LayoutParamsscreenBrightness/buttonBrightness变量直接进行设置。
其中screenBrightness表示屏幕的brightness,而buttonBrightness表示一般按键和键盘按键的brightness

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 indicating
that 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 indicating
that the screen or button backlight brightness should be set to the lowest value when this window is in front.
brightness(screenBrightness/buttonBrightness)设置到最低值。
changed系列
该系列主要用于 int copyFrom (WindowManager.LayoutParams o)函数中。
在函数中,首先将用参数中传入的WindowManager.LayoutParams的信息复制到本WindowManager.LayoutParams,然后返回一个整数,以bite形式表示调用该函数后WindowManager.LayoutParams的哪些信息发送了变化

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: 8 (0x00000008)
用于表示成员变量format是否被改变
成员变量
继承于ViewGroup.LayoutParams的成员变量

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 is
set, this is the amount of dimming to apply.
public int

抱歉!评论已关闭.