Android pull-down refresh library, implemented using viewdraghelper, integrated with pull-down refresh, more loading at the bottom, initial loading of data display loading and other functions

Source: Internet
Author: User

Android pull-down refresh library, implemented using viewdraghelper, integrated with pull-down refresh, more loading at the bottom, initial loading of data display loading and other functions

 

Android pull-down refresh library, implemented by viewdraghelper.

Integrates a drop-down refresh, loads more at the bottom, and loads the data into the loadview. It includes the modification of listview and gridview.

Effect 1:

Effect 2:

Effect 3:

Effect 4:

Effect 5:

Instructions for use:

ImageList = (ListView) findViewById (R. id. image_list); imageAdapter = new ImageAdapter (); imageList. getListView (). setAdapter (imageAdapter); imageList. setLoadDataListener (new PullToRefreshLayout. loadDataListener () {@ Override // pull-down refresh call public void onRefresh () {// simulate loading data in 1 second new Handler (). postDelayed (new Runnable () {@ Override public void run () {loadDate (true) ;}, 1000 );} @ Override // pull down to load more call public void onLoadMore () {// simulate loading data in 1 second new Handler (). postDelayed (new Runnable () {@ Override public void run () {loadDate (false) ;}, 1000 );}}); // simulate loading data in 1 second. new Handler (). postDelayed (new Runnable () {@ Override public void run () {loadDate (true) ;}, 1000 );} /*** simulate loading data ** @ param needFresh whether to refresh and clear the data or continue adding data */public void loadDate (final boolean needFresh) {// refresh, then clear the data if (needFresh) {listData. clear () ;}// add all new data to for (int I = 0; I
  

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.