Android--WindowManager.LayoutParams(下)

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

BRIGHTNESS系列

该系列主要用于设置window的
brightness
(
screenBrightness
/
buttonBrightness
)。
我们可以通过
WindowManager.LayoutParams

screenBrightness
/
buttonBrightness
变量直接进行设置。

其中
screenBrightness
表示屏幕的b
rightness
,而
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 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.

结束!

时间: 2024-08-28 10:49:30

Android--WindowManager.LayoutParams(下)的相关文章

android学习---- WindowManager.LayoutParams

WindowManager.LayoutParams 是 WindowManager 接口的嵌套类:继承于 ViewGroup.LayoutParams . 它的内容十分丰富.其实WindowManager.java的主要内容就是由这个类定义构成.下面来分析一下这个类: 定义 public static class WindowManager.LayoutParams extends ViewGroup.LayoutParams implements Parcelable 继承关系 java.l

WindowManager.LayoutParams全解

WindowManager是Android中一个重要的服务(Service ).WindowManager Service 是全局的,是唯一的.它将用户的操作,翻译成为指令,发送给呈现在界面上的各个Window.Activity会将顶级的控件注册到 Window Manager 中,当用户真是触碰屏幕或键盘的时候,Window Manager就会通知到,而当控件有一些请求产生,也会经由ViewParent送回到Window Manager中.从而完成整个通信流程.整个Android的窗口机制是基

android WindowManager解析与骗取QQ密码案例分析

最近在网上看见一个人在乌云上提了一个漏洞,应用可以开启一个后台Service,检测当前顶部应用,如果为QQ或相关应用,就弹出一个自定义window用来诱骗用户输入账号密码,挺感兴趣的,总结相关知识写了一个demo,界面如下(界面粗糙,应该没人会上当吧,意思到了就行哈=, =): demo地址:https://github.com/zhaozepeng/GrabQQPWD Window&&WindowManager介绍 分析demo之前,先要整理总结一下相关的知识.先看看Window类,Wi

WindowManager.LayoutParams 详解(转载)

WindowManager.LayoutParams 是 WindowManager 接口的嵌套类:继承于 ViewGroup.LayoutParams .它的内容十分丰富.其实WindowManager.Java的主要内容就是由这个类定义构成.下面来分析一下这个类: 定义 public static class WindowManager.LayoutParams extends ViewGroup.LayoutParams implements Parcelable 继承关系 java.la

WindowManager.LayoutParams类详解

WindowManager.LayoutParams 是 WindowManager 接口的嵌套类:继承于 ViewGroup.LayoutParams . 它的内容十分丰富.其实WindowManager.java的主要内容就是由这个类定义构成.下面来分析一下这个类: 定义 public static class WindowManager.LayoutParams extends ViewGroup.LayoutParams implements Parcelable 继承关系 java.l

Android WindowManager 小结

Android---系统服务之 ---WindowManager WindowManager是Android中一个重要的服务(Service ).WindowManager Service 是全局的,是唯一的.它将用户的操作,翻译成为指令,发送给呈现在界面上的各个Window.Activity会将顶级的控件注册到 Window Manager 中,当用户真是触碰屏幕或键盘的时候,Window Manager就会通知到,而当控件有一些请求产生,也会经由ViewParent送回到Window Man

WindowManager和WindowManager.LayoutParams的使用以及实现悬浮窗口的方法

写Android程序的时候一般用WindowManager就是去获得屏幕的宽和高,来布局一些小的东西.基本上没有怎么看他的其他的接口. 这两天想写一个简单的类似于Toast的东西,自定义布局,突然发现,原来Toast的时间是不能自己定义的,只有两个固定的时间,分别是2秒和3.5秒.我的需求是自定义显示的时间,这个显然不能满足我的需求.但是它是如何做到显示一个View凌驾于现有的所有的View之上的呢? 我们Android平台是一个又一个的Activity组成的,每一个Activity有一个或者多

Android中自定义下拉样式Spinner

Android中自定义下拉样式Spinner 本文继续介绍android自定义控件系列,自定义Spinner控件的使用. 实现思路 1.定义下拉控件布局(ListView及子控件布局) 2.自定义SpinerPopWindow类 3.定义填充数据的Adapter 效果图 一.定义控件布局 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:/

Android UI- PullToRrefresh自定义下拉刷新动画

Android UI- PullToRrefresh自定义下拉刷新动画 如果觉得本文不错,麻烦投一票,2014年博客之星投票地址:http://vote.blog.csdn.net/blogstar2014/details?username=wwj_748#content 本篇博文要给大家分享的是如何使用修改开源项目PullToRrefresh下拉刷新的动画,来满足我们开发当中特定的需求,我们比较常见的一种下拉刷新样式可能是以下这种: 就是下拉列表的时候两个箭头上下翻转,更改日期文本和刷新状态,