分享

WindowManager.LayoutParams(下)

 點點滴滴 2012-08-09

WindowManager.LayoutParams(下)  

2011-08-07 08:08:54|  分类: Android基础 |  标签:windowmanager   |字号 订阅

本文参照自:http://developer./reference/android/view/WindowManager.LayoutParams.html
BRIGHTNESS系列
该系列主要用于设置window的brightness(screenBrightness/buttonBrightness)我们可以通过WindowManager.LayoutParamsscreenBrightness/buttonBrightness变量直接进行设置。
其中screenBrightness表示屏幕的brightness,而buttonBrightness表示一般按键和键盘按键的brightness
floatBRIGHTNESS_OVERRIDE_FULLValue 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)设置到最高值。
floatBRIGHTNESS_OVERRIDE_NONEDefault 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)重新进行设置,采用默认的普通值。
floatBRIGHTNESS_OVERRIDE_OFFValue 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的哪些信息发送了变化
intALPHA_CHANGED用于表示成员变量alpha是否被改变
intANIMATION_CHANGED用于表示成员变量windowAnimations是否被改变
intDIM_AMOUNT_CHANGED用于表示成员变量dimAmount是否被改变
intFLAGS_CHANGED用于表示成员变量flags是否被改变
intLAYOUT_CHANGED用于表示layout是否被改变.这里的layout是指以下变量所包含的信息:
width,height,x,y, verticalMargin,verticalWeight,horizontalMargin,horizontalWeight
intSCREEN_BRIGHTNESS_CHANGED用于表示brightness是否被改变.
这里的
brightness是指以下变量对应的信息:screenBrightness,buttonBrightness
intSCREEN_ORIENTATION_CHANGED用于表示成员变量screenOrientation是否被改变
intSOFT_INPUT_MODE_CHANGED用于表示成员变量softInputMode是否被改变
intTITLE_CHANGED用于表示成员变量title是否被改变
intTYPE_CHANGED用于表示成员变量type是否被改变
intFORMAT_CHANGEDConstant Value: 8 (0x00000008)
用于表示成员变量format是否被改变
成员变量
继承于ViewGroup.LayoutParams的成员变量
public intheightInformation about how tall the view wants to be.
public LayoutAnimationController.AnimationParameterslayoutAnimationParametersUsed to animate layouts.
public intwidthInformation about how wide the view wants to be.
自身的成员变量
public static final Creator<WindowManager.LayoutParams>CREATOR
public floatalphaAn alpha value to apply to this entire window.
public floatbuttonBrightnessThis can be used to override the standard behavior of the button and keyboard backlights.
public floatdimAmountWhen FLAG_DIM_BEHIND is set, this is the amount of dimming to apply.
public intflagsVarious behavioral options/flags.
public intformatThe desired bitmap format.
public intgravityPlacement of window within the screen as per Gravity.
public floathorizontalMarginThe horizontal margin, as a percentage of the container's width, between the container and the widget.
public floathorizontalWeightIndicates how much of the extra space will be allocated horizontally to the view associated with these LayoutParams.
public intmemoryTypeThis field is deprecated. this is ignored
public StringpackageNameName of the package owning this window.
public floatscreenBrightnessThis can be used to override the user's preferred brightness of the screen.
public intscreenOrientationSpecific orientation value for a window.
public intsoftInputModeDesired operating mode for any soft input area.
public intsystemUiVisibilityControl the visibility of the status bar.
public IBindertokenIdentifier for this window.
public inttypeThe general type of window.
public floatverticalMarginThe vertical margin, as a percentage of the container's height, between the container and the widget.
public floatverticalWeightIndicates how much of the extra space will be allocated vertically to the view associated with these LayoutParams.
public intwindowAnimationsA style resource defining the animations to use for this window.
public intxX position for this window.
public intyY position for this window.
成员函数
ublic Methods
final intcopyFrom(WindowManager.LayoutParams o)
Stringdebug(String output)
Returns a String representation of this set of layout parameters.
intdescribeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
final CharSequencegetTitle()
static booleanmayUseInputMethod(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 voidsetTitle(CharSequence title)
StringtoString()
Returns a string containing a concise, human-readable description of this object.
voidwriteToParcel(Parcel out, int parcelableFlags)
Flatten this object in to a Parcel.
结束!

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多