Android source code: Gallery (2), androidgallery

Source: Internet
Author: User

Android source code: Gallery (2), androidgallery
Introduction

The data loading process has been explained in the previous article. Next, let's take a look at the data loading process. According to the normal thinking logic, after loading data, we should consider the data display logic.

MVC display logic

Everyone may be familiar with the MVC Architecture of J2EE. What is the relationship between Gallery2 and MVC ??? First of all, we first recall the software design ideas and design principles (please refer to the specific http://blog.csdn.net/cdl2008sky/article/details/6364396), a simple summary is tight cohesion, loose coupling, layering. Finally, Let's explain the MVC idea. The idea of MVC is to separate the display layer (View) logic from the Control layer (Control) logic. After reviewing the above knowledge points, let's see if Gallery2's design conforms to MVC's design philosophy. When presenting complex behaviors, charts are often more persuasive than languages, so I also use charts to prove my point of view. For details, see Figure 1-1:


Figure 1-1

The class Relation Diagram of Gallery's main logic is shown simply. We can see that Gallery's design adopts the MVC hierarchical design idea. In the next time, we will analyze the implementation method of Gallery layer by layer.

After entering the image library, you will first see the data processed by AlbumSetPage (album set). When you click a specific album, the data processed by AlbumPage (photo set) will be displayed; when you click an image, the data processed by PhotoPage is displayed. The main process of the Image Library isImage Browsing,Image editingAndApplication InteractionFunction (Note: image editing and application interaction are analyzed in subsequent articles ). Charts are the best expression. Let's take a look.Image BrowsingThe flowchart of the process, as shown in figure 1-2:


Figure 1-2

We can see the Gallery.Image BrowsingAs for the overall call processImage editingAndApplication InteractionThe logical structure of the function is relatively simple, so I will not elaborate on it too much here. If you are interested, you can study it on your own. If you have any questions about the image library, you can raise them in your blog comments to discuss them and make progress together.



Android42 Gallery2 source code import Eclipse Problems

Right-click the Gellery folder, select propertier, and select android. In the project buider target, select the targe of android 4.2.

What is the source code location of the Android app Gallery?

In Camera,/android/packages/apps/Camera/com/android/camera/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.