android view 的学习

来源:互联网 发布:linux monitor 编辑:程序博客网 时间:2024/06/07 02:08

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


http://blog.csdn.net/qinjuning/article/details/7110211




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









0 0
原创粉丝点击