Introduction
The previous article has explained the data loading process, and then let's take a look at the data loading process. According to the normal thinking logic. When the data is loaded, the next step is to consider the display logic of the data.
MVC Display Logic
You may be familiar with the MVC architecture of the Java EE, what is the relationship between Gallery2 and MVC, is it nonsense??? First of all, we first review the concept of software design and design principles (detailed please refer to http://blog.csdn.net/cdl2008sky/article/details/6364396), simple generalization is tight cohesion, loose coupling, layering. Finally, try to explain the idea of MVC. The idea of MVC is to separate the display layer (view) logic from the control layer logic. The above knowledge points are reviewed. Let's look at whether Gallery2 's design conforms to MVC's design philosophy.
When it comes to complex behavior, charts tend to be more persuasive than words, so there are practical charts to illustrate my point.
See Figure 1-1 for details:
Figure 1-1
Simple representation of the class diagram of gallery's main logic. We can clearly see that gallery's design uses the MVC layering design idea. The next time we will follow through, a layer of analysis of the implementation of gallery.
When the user enters the gallery, the first thing to see is the Albumsetpage (album set) processing data information. When the user clicks on a detailed album, the data Information processed by the Albumpage (Photo gallery) is displayed, and when the user clicks on a detailed picture, the data information processed by the Photopage is displayed. The main process of the gallery is image browsing , image editing , and application interactivity (Note: image editing and application interaction are analyzed in the article). Chart is the best way to express, we look at the picture of the process flow chart, detailed 1-2 see:
Figure 1-2
From here we can see the overall call flow of Gallery Gallery picture browsing , as far as the logical structure of image editing and application interaction function is compared. There is no too much elaboration here. Interested students can study by themselves. Everyone assumes that there is something wrong with the gallery and can be presented in a blog comment. Discuss together and make progress together.
Android Source Code Gallery special Study (2)