回去window属性
WindowManager.LayoutParams l = r.window.getAttributes();

Decor 为PhoneWindow.DecorView 这个View其实是一个Activity 的最底层View
wm.addView(decor, l);


调用PhoneWindow的LocalWindowManager 中的addView

        public final void addView(View view, ViewGroup.LayoutParams params) {            // Let this throw an exception on a bad params.            WindowManager.LayoutParams wp = (WindowManager.LayoutParams)params;            CharSequence curTitle = wp.getTitle();            if (wp.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW &&                wp.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {                if (wp.token == null) {                    View decor = peekDecorView();                    if (decor != null) {                        wp.token = decor.getWindowToken();                    }                }                if (curTitle == null || curTitle.length() == 0) {                    String title;                    if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA) {                        title="Media";                    } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY) {                        title="MediaOvr";                    } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) {                        title="Panel";                    } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL) {                        title="SubPanel";                    } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG) {                        title="AtchDlg";                    } else {                        title=Integer.toString(wp.type);                    }                    if (mAppName != null) {                        title += ":" + mAppName;                    }                    wp.setTitle(title);                }            } else {                if (wp.token == null) {                    wp.token = mContainer == null ? mAppToken : mContainer.mAppToken;                }                if ((curTitle == null || curTitle.length() == 0)                        && mAppName != null) {                    wp.setTitle(mAppName);                }           }            if (wp.packageName == null) {                wp.packageName = mContext.getPackageName();            }            mWindowManager.addView(view, params);        }

调用 WindowManagerImpl 的addView
进一步调用如下方法:
final WindowManager.LayoutParams wparams                = (WindowManager.LayoutParams)params;root.setView(view, wparams, panelParentView);



ViewRoot里面也有一个Window Attribute变量mWindowAttributes ---Window
attrs 为Window的Attribute mWindowAttributes.copyFrom(attrs);--ViewRoot
这是两个不同的对象,有时间内容相同。 具体看代码。

更多相关文章

  1. Android View measure (五) 支持margin属性,从一个异常说起
  2. java android maven环境变量基本配置
  3. Android Banner属性设置
  4. Android 用属性动画自定义view的渐变背景
  5. android 属性动画之 ObjectAnimator
  6. android makefile 常用宏名称和内置变量
  7. Android 设置对话框中的确定按钮的 enabled 属性
  8. android 设置activity通用的全局变量(新手必备)

随机推荐

  1. Android studio 3.0和unity交互 Manifest
  2. Android Studio & HTTP Proxy
  3. android 获取系统默认路径
  4. android点击实现图片放大缩小
  5. Android AESUtils 工具类与调用方法
  6. XE7 Android 中使用 MessageDlg 范例
  7. Android Root SuperUser su相关资源
  8. ubuntu下Android源码下载编译运行,单独编
  9. 获得root权限
  10. android 创建快捷图标demo