2020-11-21

1. The above picture is a part of Android navigator, because the core code navigation part of NavController is if the line is not reflected in the code.

Let's briefly talk about the parsing process of the xml navigation file. 

NavHostFragment:

    1. Get the ID of the navigation of the navigation resource file. This is a member of NavHostFragment. 

    2. Create the NavController object. This object is a core control object. Including life cycle, navigation diagram, stack structure. Navigation target object subclass collection. 

    3. The formation process of the navigation graph object, the main core code is in NavInflater, the xml file used in the analysis process has been listed in the figure. Obtain the resource file through the TypeArray (AttrbuiteSet) XmlParser object to form a navigation graph. 

 

Guess you like

Origin blog.csdn.net/shaohuazuo/article/details/109908079