Modify android4.4 Gallery Series Four (v)--android4.4.2 The whole structure analysis of the library

Source: Internet
Author: User

Until today, modified one months of the Android library source end! The specific content of the modification is to kill the Actionbar in the gallery, and then customize the Actionbar. To achieve the effect, all events of the custom Actionbar must also be bound to the click events on the original Actionbar. To this end, it is necessary to analyze the overall structure of the library, the conversion relationship between the various interfaces, and the role of most classes.

The following changes are followed:

First of all, we have to say that the source of the library is really powerful, light local Java code has more than 500 classes, there are many JNI code. Can learn a lot of things from it.

One, the conversion between the interface

The main interface is three: an album display interface, an album display interface, a picture or video display interface. The conversion diagram is as follows (this figure can be found in Com.android.gallery3d.app.AlbumPage.java):

1, album set corresponding class: Albumsetpage.java.

2, Album corresponding class: Albumpage.java.

3, the picture corresponds to the class: Photopage.java.

4, all Actionbar by the class Galleryactionbar.java management.

5. All menu events are managed by Menuexecutor.java.

6, Picture pruning class: Filtershowactivity.java.

7, Video Pruning class: Trimvideo.java.

Second, the incident analysis

The main events are the display of pictures, videos, and control events on Actionbar.

Using Hierarchyviewer tools, while interrupting points, Ddms debugging, it is easy to find the source of each event. This is not analyzed here. Interested can be debugged on their own.

Modify android4.4 Gallery Series Four (v)--android4.4.2 The whole structure analysis of the library

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.