Android Open Source project source code analysis (phase II)

Source: Internet
Author: User
Tags eventbus

Android Open Source project source code analysis (phase II)

Read Catalogue

    • Android-ultra-pull-to-refresh Source parsing
    • dynamicloadapk source parsing
    • nineoldanimations source parsing
    • Slidingmenu Source parsing
    • Cling source parsing
    • baseadapterhelper source Analysis
    • Side menu.android Source parsing
    • Discreteseekbar Source parsing
    • Calendarlistview source parsing
    • Pagerslidingtabstrip Source parsing
    • Public technology point of Android Animation Basics
    • Common technical Point Java reflection Reflection
    • Volley source parsing
    • Android Universal Image Loader Source Analysis
    • Dagger Source code parsing
    • Eventbus Source code parsing
    • xutils Source code parsing
    • viewpagerindicator Source code parsing
    • holographlibrary Source code parsing
    • Circularfloatingactionmenu Source code parsing
    • PhotoView Source code parsing
    • Android Lock Pattern Source parsing
    • Java Dynamic Proxy for the public technology point
    • Java annotations for public technical points Annotation
    • View Drawing process of public technology point
    • Dependency Injection of public technology points
    • View Event delivery for public technology points
Original http://codekk.com/open-source-project-analysis Android-ultra-pull-to-refresh Source code Analysis

A powerful andriod drop-down refresh frame. Main Features: (1) Inheriting from Viewgroup,content not only can be used in the ListView, GridView, can also be any other View. (2) Concise and perfect header abstraction, easy to expand, build the head to meet the needs. Ultraptr Overall design is relatively simple and clear, first abstracted two interfaces, functional interface and UI interface. The Ptrhandler represents a pull-down refresh function interface that includes a refresh function callback method and a method to determine if it can be pulled down. The user implements this interface to perform data refresh work.

DYNAMICLOADAPK Source Code Analysis

DYNAMICLOADAPK is an open source Android plugin framework. The advantages of the plug-in include: (1) module decoupling, (2) dynamic upgrade, (3) Efficient parallel development (faster compilation Speed) (4) load on demand, lower memory consumption and so on. The principle is dexclassloader plus activity agent, that is, in the container to register the activity of several agents, the activation of the plug-in activity is actually initiated by the agent activity, so as to resolve the activity must register the problem.

Nineoldanimations Source Code Analysis

Nineoldandroids is a framework that supports the use of Android property animations and 3D rotation animations in the lower version (under API 11), which provides a range of viewanimator, Objectanimator, Viewpropertyanimator and other APIs to complete these animations, addressing the compatibility issues of the Android animation framework in the low version. After the API one (honeycomb-android 3.0) Android launched animation effects such as property animation, X-axis rollover, but these effects can not be run under the API 11, the appearance of nineoldandroids makes these animation effects compatible with the lower version of the system, Ensure that animations work perfectly in each system version.

Slidingmenu Source Code Analysis

Slidingmenu is a powerful sidebar menu that slides out of the menu by dragging the edges of the screen, supports screen left and right, supports menu Zoom, scale, and Slide up three animation styles. The main features are as follows: (1) The sidebar can be a Fragment, including any View, (2) easy to use, support left and right slide, etc. (3) Customize the sidebar display animation.

Cling Source Code Analysis

The Cling class library is the DLNA/UPNP protocol stack implemented by Java. Based on DLNA/UPNP, we can develop applications such as multi-screen interaction, resource sharing, remote control and so on, and manage one or more devices through the Android app to push audio, video, and images to the specified device display. The work process for UPnP can be divided into 6 steps: Addressing (addressing), Discovery (Discovery), description (Description), control, event (eventing), Presentation (Presentation).

Baseadapterhelper Source Code Analysis

Base-adapter-helper is an encapsulation of the traditional baseadapter viewholder pattern. The main function is to simplify the code we write Abslistview Adapter, such as Listview,gridview. Advantages (1) Provide qucikadapter and omit the writing of abstract functions like GetCount (), just focus on the display of Model to View. (2) A number of auxiliary methods for View operations are encapsulated in the baseadapterhelper.

Side menu.android Source Code Analysis

Yalantis Open Source Animation experience great Side menu, which opens as a page turn effect.

Discreteseekbar Source Code Analysis

Discreteseekbar implements a SeekBar similar to the Material design style. Discreteseekbar can be used in more than 2.1 of applications, you can configure the display format in XML, or you can customize the displayed numbers or specify display characters in your code. The use method is similar to SeekBar, very simple.

Calendarlistview Source Code Analysis

Calendarlistview is a control that makes it easy to select dates from the calendar and supports up to API 10, just add Daypickerview to your layout. You can select a time period by using the date selector implemented by the control Recycleview.

Pagerslidingtabstrip Source Code Analysis

Pagerslidingtabstrip is used in conjunction with Viewpager Indicator, support Viewpager Scroll when Indicator linkage. The principle of pagerslidingtabstrip realization of linkage effect is to call Viewpager's Onpagechangelistener. But Viewpager registered Listener is not its own onpagechangelistener, but Pagerslidingtabstrip inner class pagelistener. The encapsulation of Viewpager and Tab is achieved through Pagelistener. So as to achieve sliding linkage effect.

Basics of Android Animation for the public technology point

It simply introduces the concepts of View and property animations, how to create resource files in your project, and how to use them in your code.

Java Reflection Reflection of public technology point

Describes Java reflection, how to get classes, properties, methods, parent classes, interfaces, annotations, and so on through reflection.

Volley Source Code Analysis

Volley is the Android asynchronous network request framework and picture loading framework that Google launched at the I/O conference. Especially suitable for network operation with small data volume and frequent communication. Volley is mainly through the two Diapatch Thread constantly withdraw requests from the Requestqueue, depending on whether the cache or Network is cached to call one of the two data acquisition interfaces, from the memory cache or the server to obtain the requested data, and then to Respon Sedelivery to do the result distribution and callback processing.

Android Universal Image Loader Source Analysis

Universal Image Loader is a powerful, highly customizable picture cache. The whole library is divided into five modules of Imageloaderengine,cache and Imagedownloader,imagedecoder,bitmapdisplayer,bitmapprocessor, of which the Cache is divided into MemoryCache and DiskCache two parts. Simply speaking, Imageloader receives the task of loading and displaying the picture and handing it over to the Imageloaderengine,imageloaderengine distribution task to the specific thread pool to execute, the task through the Cache and Imagedownloader Get the picture, the middle may go through bitmapprocessor and imagedecoder processing, the final conversion to Bitmap to Bitmapdisplayer in Imageaware display.

Dagger Source Code Analysis

Dagger is a dependency injection library for the Java platform. Java's Dependency Injection library, the most famous guice,spring that should be Google, is also famous, but focused on the development of the EE. The Guice feature is very powerful, but it is by reading annotations at runtime to implement dependency injection, relying on the generation and injection needs to rely on Java reflection mechanism, which is a very sensitive to the performance of Android is a mishap. Based on this, Dagger was born. Dagger also uses annotations to implement dependency injection, but it uses APT (Annotation Process Tool) to generate auxiliary classes at compile time, which inherit a specific parent class or implement a specific interface, and the program Dagger load these auxiliary classes at run time. Call the appropriate interface to complete the dependency generation and injection. Dagger has a very small impact on the performance of the program, so it is more suitable for Android application development.

Eventbus Source Code Analysis

Eventbus is an Android event publish/Subscribe framework that simplifies the delivery of Android events by decoupling publishers and subscribers, where events can be understood as messages, collectively called events in this article. Event delivery can be used to communicate between the four components of Android, as well as the communication between the user's asynchronous thread and the main thread, among others. Traditional event delivery methods include: Handler, Broadcastreceiver, Interface callbacks, in contrast to Eventbus's advantages are code simplicity, ease of use, and the full decoupling of event publishing and subscriptions.

Xutils Source Code Analysis

Xutils an Android public library, mainly including View,db, Http, Bitmap four modules. The main function of the View module is to bind UI, resources, and events through annotations. The DB module is a database ORM framework, and simple statements are able to manipulate the data. The Http module mainly accesses the network, supports synchronous, asynchronous requests, and supports the download of files. The Bitmap module is the process of loading pictures and images, supports loading local, network images, and supports image memory and local cache.

Viewpagerindicator Source Code Analysis

The interface navigation of Viewpagerindicator common language Viewpager. Main features: Simple to use, full-style, easy to expand. The overall design of the project is very simple, a Pageindicator interface class, the specific style of the navigation class implementation of the interface, and then according to the specific style to implement the corresponding logic. The extension of Icslinearlayout:linearlayout supports more than 4.0 of the divider features. Circlepageindicator, Linepageindicator, Underlinepageindicator, titlepagerindicator inherit from View. Tabpageindicator and Iconpageindicator inherit from Horizontalscrollview.

Holographlibrary Source Code Analysis

Holographlibrary is an item that can be used to draw a chart, which supports drawing lines, histograms, and pie charts. The graphic design is friendly and easy to use. However, the library itself code generally, it is recommended to absorb the principle of reconstruction and not directly used.

Circularfloatingactionmenu Source Code Analysis

Circularfloatingactionmenu is a (non-complete) round pop-up menu similar to the well-known application Path menu. Customizable menus and animations are easy to customize. Supports custom animations, menus, angle ranges, radii, and more. The source code is divided into two parts, part is the View part of the menu, and the other part is the animation operation class.

PhotoView Source Code Analysis

PhotoView is a ImageView that supports double-tap or two-finger scaling. Supports Pinch gesture free scaling, supports double-click zoom/restore, supports smooth scrolling, works well under sliding parent controls, supports event monitoring based on Matrix changes (zoom in/out/move). PhotoView This library is actually relatively simple, the key point is actually the Touch event processing and the Matrix graphics transformation application.

Android Lock Pattern Source parsing

Lock pattern is the Android pattern cipher unlock Library, which represents the unlock password by drawing a pattern from the point matrix of the gesture connection 3 * 3. Support Action_create_pattern, Action_compare_pattern, Action_verify_captcha Three kinds of action mode.

Java Dynamic agent of public technology point

In some cases, we do not want or can not directly access object A, but by accessing a mediation object B, B to access a to achieve the purpose, this way we are called proxies. Here object A belongs to the class that we call the delegate class, also known as the proxy class, and object B belongs to the class called the proxy class. Depending on whether the agent class already exists before the program runs, you can divide the agent into static agents and dynamic proxies.

Java Annotations Annotation of public technical points

Annotations refer to syntax metadata that can be added to Java source code. Classes, methods, variables, parameters, and packages can be annotated, and can be used to correlate information metadata with program elements. Annotation Chinese is often translated as "annotations", the main functions of annotations include a. tag, which tells the compiler some information. B. Compile-time dynamic processing, such as dynamically generated code. C. Run-time dynamic processing, such as getting annotation information.

View drawing process of public technology point

When the Activity receives the focus, it is asked to draw the layout, which is handled by the Android framework. Drawing is the measure and draw of the layout tree starting from the root node. The entire view tree's drawing flow is expanded in the Performtraversals () function of the Viewroot.java class, and the function does a simple overview of whether the view size needs to be recalculated (measure), where the view needs to be relocated (layout), and whether redraw (draw) is required.

Dependency injection of public technology points

If there is an instance of Class B in Class A, it is said that Class A has a dependency on class B. Instead of proactively initializing dependencies, we call it dependency injection in a way that relies on external input. Simply put, there are two main benefits of Dependency injection: (1). Decoupling, decoupling the dependencies. (2). Because it is decoupled, it is convenient to do unit tests, especially Mock tests.

View Event Delivery at the public technology point

All touch events are encapsulated as motionevent objects, including touch location, time, history, and the first few fingers (multi-fingered touch). The event types are divided into Action_down, action_up, Action_move, Action_pointer_down, Action_pointer_up, Action_cancel, and each event is ACTION_DOWN Start, Action_up end. The handling of events consists of three classes, namely the pass--dispatchtouchevent () function, The Intercept--onintercepttouchevent () function, the consumption--ontouchevent () function, and the Ontouchlistener.

Android Open Source project source code analysis (phase II)

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.