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

android view 的学习

2015-06-05 17:37 561 查看

Android中View绘制流程以及invalidate()等相关方法分析

/article/1390935.html

Android中将布局文件/View添加至窗口过程分析 ---- 从setContentView()谈起

frameworks/base/core/java/android/view/Window.java //抽象类

/**

* Abstract base class for a top-level window look and behavior policy. An

* instance of this class should be used as the top-level view added to the

* window manager. It provides standard UI policies such as a background, title

* area, default key processing, etc.

*

* <p>The only existing implementation of this abstract class is

* android.policy.PhoneWindow, which you should instantiate when needing a

* Window. Eventually that class will be refactored and a factory method

* added for creating Window instances without knowing about a particular

* implementation.

*/

PhoneWindow是唯一的这个抽象类的实现。 factory method是 Java工厂模式

frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

/**

* WindowManagerPolicy implementation for the Android phone UI. This

* introduces a new method suffix, Lp, for an internal lock of the

* PhoneWindowManager. This is used to protect some internal state, and

* can be acquired with either the Lw and Li lock held, so has the restrictions

* of both of those when held.

*/

启动一个应用,会调用addStartingWindow
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: