Analysis of Android in ViewRootImpl class

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:

  1. Links WindowManager and DecorView link, or you can say is the link between the Window and View;
  2. View the complete drawing process, comprising a measure, layout, draw process;
  3. 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:

  1. Android window mechanism (a) - Window, PhoneWindow, DecorView understand
  2. Window window mechanism (b) - Window, WindowManager understand
  3. Window window mechanism (three) - WindowManager, ViewRootImpl, View to understand
    Window window mechanism

(2) the completion of the drawing process View

You can learn more from the following four posts:

  1. Android view drawing flow analysis (a)
  2. Android view drawing flow analysis (II)
  3. Android view drawing flow analysis (c)
  4. Android view drawing flow analysis (IV)
    View of the drawing process

(3) event distribution mechanism

You can learn more from the following four posts:

  1. Android event distribution mechanism --ViewRootImpl articles (prequel)
  2. Android event distribution mechanism --View (a)
  3. Android event distribution mechanism --ViewGroup (b)
  4. Android event distribution mechanism - example (c)

ViewRootImpl distributes events to ViewGroup process
ViewRootImpl event distribution
ViewGroup events are distributed to View process
ViewGroup event distribution

Guess you like

Origin blog.csdn.net/dongxianfei/article/details/83894035