android graphic: how activity show itself?

 

there is a long jounery toward activity to show itself.

 

the last steps that are most interesting are

 

1) add view to wms.

this is the best picture I have ever get to describe the process.

 

1)  a decor view is registed to wms.  decor view works as the root of the view hierachy, it's actually a viewgroup that holds the whole view.

    you can access decorview through viewrootimpl.mview member.

windowManagerGlobal.java

 

the View is the decorview.

public void addView(View view, ViewGroup.LayoutParams params,
Display display, Window parentWindow)

  root = new ViewRootImpl(view.getContext(), display);

   mViews[index] = view;

  mRoots[index] = root;

   root.setView(view, wparams, panelParentView);

}

2) viewrootimpl is created and added to mRoots[] array which hold all viewroot of the application. for example, if you create another alert window,

there will be another viewroot.

 

viewroot is an important role in drawing the view.   actually, it's performTraveral() acts as the entry point for drawing.

also , as the picture, it works as the interface that acts with WMS.  WMS sends user input to viewroot,

viewroot calls wms to addview.

 

 

 

reference:

http://blog.csdn.net/maxleng/article/details/5557758

posted on 2013-08-25 11:25  keniee  阅读(370)  评论(0编辑  收藏  举报