Android-ultra-pull-to-refresh Learning

Source: Internet
Author: User

本文是学习Android 开源项目源码解析 中 android-Ultra-Pull-To-Refresh  部分的笔记。原文:[http://a.codekk.com/detail/Android/Grumoon/android-Ultra-Pull-To-Refresh%20源码解析]
1 features

Download demo own experience, mainly drop-down refresh.

2. Overall design

First, two interfaces, functional interfaces and UI interfaces are abstracted.

PtrHandler 代表下拉刷新的功能接口,包含刷新功能回调方法以及判断是否可以下拉的方法。用户实现此接口来进行数据刷新工作。
Header 需要实现此接口,来处理下拉刷新过程中头部 UI 的变化。

The entire project revolves around the core class ptrframelayout. Ptrframelayout represents a drop-down refresh of the custom control.
Ptrframelayout inherits from ViewGroup and has only two sub-View, header header and content. Usually the Header implements the Ptruihandler interface, and Content can be any View.
As with all custom controls, Ptrframelayout determines the size and position of the control by overriding Onfinishinflate, Onmeasure, and OnLayout. The drop-down behavior of the control is determined by overriding the dispatchtouchevent.

Android-ultra-pull-to-refresh Learning

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.