liaohuqiu /android-Ultra-Pull-To-Refresh

Ultra Pull to Refresh for Android. Support all the views.

★ 9,489⑂ 2,608👁 432⑃ 51● 297▤ 8
JavaMITCreated 2014-11-13
Download: 1.0.111.0.11 ↓1.0.112015-09-19
-1
Daily
9,489
stars
2,608
forks
432
watchers
51
prs
297
issues
8
releases

README

Welcome to follow me on GitHub or Twitter

GitHub: https://github.com/liaohuqiu

Twitter: https://twitter.com/liaohuqiu

---




 中文版文档

Wanna auto-load-more? This will be what you want: https://github.com/liaohuqiu/android-cube-app

 Ultra Pull To Refresh

It's a replacement for the deprecated pull to refresh solution. It can contain any view you want.

It's easy to use and more powerful than SwipeRefreshLayout.

It's well designed, you can customize the UI effect you want as easy as adding a headview to ListView.

Support API LEVEL = 8, all snapshots are taken from Genymotion, 2.3.7.

Download APK

 StoreHouse Style first! Thanks to CBStoreHouseRefreshControl.
    
        
        
    

 Material Style, added @ 2014-12-09. There is a beautiful shadow which looks terrible in gif snapshot. Please Check out the DEMO.
    
        
    

 Supports all of the views: 
    ListView, GridView, ScrollView, FrameLayout, or Even a single TextView.
    

 Supports all of the refresh types.
     pull to refresh
        
     release to refresh
        

     keep header when refresh 

        

     hide header when refresh

        

     auto refresh

        

 Usage

 Maven Central

This project has been pushed to Maven Central, both in aar and apklib.

The latest version: 1.0.11, has been published to: https://oss.sonatype.org/content/repositories/snapshots, in gradle:


maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots'
}


The stable version: 1.0.11, https://oss.sonatype.org/content/repositories/releases, in gradle:


mavenCentral()


pom.xml, latest version:

xml

    in.srain.cube
    ultra-ptr
    aar
    
    apklib --
    1.0.11



pom.xml, stable version:

xml

    in.srain.cube
    ultra-ptr
    aar
    
    apklib --
    1.0.11



gradle, latest version:


compile 'in.srain.cube:ultra-ptr:1.0.11'


gradle, stable version:


compile 'in.srain.cube:ultra-ptr:1.0.11'


 Config

There are 6 properties:

 Resistence

    This is the resistence while you are moving the frame, default is: 1.7f.

 Ratio of the Height of the Header to Refresh

    The ratio of the height of the header to trigger refresh, default is: 1.2f.

 Duration to Close

    The duration for moving from the position you relase the view to the height of header, default is 200ms.

 Duration to Close Header

    The default value is 1000ms

 Keep Header while Refreshing

    The default value is true.

 Pull to Refresh / Release to Refresh

    The default value is Release to Refresh.

 Config in xml

xml


    

        
    




 Or config in java code

java
// the following are default settings
mPtrFrame.setResistance(1.7f);
mPtrFrame.setRatioOfHeaderHeightToRefresh(1.2f);
mPtrFrame.setDurationToClose(200);
mPtrFrame.setDurationToCloseHeader(1000);
// default is false
mPtrFrame.setPullToRefresh(false);
// default is true
mPtrFrame.setKeepHeaderWhenRefresh(true);


 Other Config

  setPinContent. Pin the content, only the HeaderView will be moved. 

    Th

Top issues

Latest release

1.0.11 1.0.11 2015-09-19
Fix some memory leaks.

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON