您的位置:首页 > 移动开发 > Android开发

Android--WindowManager.LayoutParams(下)

2013-12-09 10:40 134 查看
本文参照自:http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html

BRIGHTNESS系列

该系列主要用于设置window的brightness(screenBrightness/buttonBrightness)。我们可以通过WindowManager.LayoutParams的screenBrightness/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.
结束!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: