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