Disclaimer: This article is a blogger original article, reproduced welcome but must indicate the source Thank you! https://blog.csdn.net/dongxianfei/article/details/83894035
We have previously spent eleven blog analyzes related ViewRootImpl function, today we have to summarize ViewRootImpl.
Its main role my conclusion is as follows:
- Links WindowManager and DecorView link, or you can say is the link between the Window and View;
- View the complete drawing process, comprising a measure, layout, draw process;
- To distribute user-initiated DecorView received event events, such as button / touch screen and other events.
(1) link WindowManager and DecorView
If you want to learn more, please refer to the following three posts:
- Android window mechanism (a) - Window, PhoneWindow, DecorView understand
- Window window mechanism (b) - Window, WindowManager understand
- Window window mechanism (three) - WindowManager, ViewRootImpl, View to understand
(2) the completion of the drawing process View
You can learn more from the following four posts:
- Android view drawing flow analysis (a)
- Android view drawing flow analysis (II)
- Android view drawing flow analysis (c)
- Android view drawing flow analysis (IV)
(3) event distribution mechanism
You can learn more from the following four posts:
- Android event distribution mechanism --ViewRootImpl articles (prequel)
- Android event distribution mechanism --View (a)
- Android event distribution mechanism --ViewGroup (b)
- Android event distribution mechanism - example (c)
ViewRootImpl distributes events to ViewGroup process
ViewGroup events are distributed to View process