博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android DecorView与ViewRootImpl
阅读量:7071 次
发布时间:2019-06-28

本文共 1269 字,大约阅读时间需要 4 分钟。

hot3.png

结构关系

ViewRootImpl单独是一个普通类,不是视图类。没有继承View。

DecorView是PhoneWindow的一个内部类,是一个视图类继承FrageLayout(ViewGroup).

ViewRootImpl.javapublic final class ViewRootImpl implements ViewParent,        View.AttachInfo.Callbacks, HardwareRenderer.HardwareDrawCallbacks {    //...    ...}PhoneWindow.javapublic class PhoneWindow extends Window implements MenuBuilder.Callback {        private final class DecorView extends FrameLayout implements RootViewSurfaceTaker {      //...      ...    }   }Window.javapublic abstract class Window {    //    ...}

 

// This is the view in which the window contents are placed. It is either    // mDecor itself, or a child of mDecor where the contents go.    private ViewGroup mContentParent;    private void installDecor() {        if (mDecor == null) {            mDecor = generateDecor();            mDecor.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);            mDecor.setIsRootNamespace(true);            if (!mInvalidatePanelMenuPosted && mInvalidatePanelMenuFeatures != 0) {                mDecor.postOnAnimation(mInvalidatePanelMenuRunnable);            }        }        if (mContentParent == null) {            mContentParent = generateLayout(mDecor);            ...        }    }

 

转载于:https://my.oschina.net/yuerliang/blog/894232

你可能感兴趣的文章
通过文件句柄获取文件的路径
查看>>
【转】什么是非对称加密、数字签名、数字证书
查看>>
2015-06-30(最新)手机号正则表达式- 校验示例
查看>>
spring-mvc 3.* 多视图解析配置实例 ContentNegotiatingViewResolver
查看>>
09.移动先行之谁主沉浮----控件之轮流轰炸——高级控件
查看>>
Python3 与 C# 扩展之~基础衍生
查看>>
完全数
查看>>
HDU2017多校联合 contest 2
查看>>
unicode和utf-8互转
查看>>
在IIS上部署Analysis Services
查看>>
BZOJ2346:[Baltic 2011]Lamp(最短路)
查看>>
Fedora19 搭建LAMP环境
查看>>
Optimizing web servers for high throughput and low latency
查看>>
什么是 DIV + CSS 有哪些优势
查看>>
购物车的原理及实现.(仿京东实现原理)
查看>>
Kotlin 1 包,数据类型,普通类和接口
查看>>
Load和Initialize往死了问是一种怎样的体验?
查看>>
PHPer面试指南-Web 篇
查看>>
[Kernel参数]----/etc/sysctl.conf
查看>>
解决springboot启动失败问题:Unable to start embedded container;
查看>>