-1
日增长
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.
ThTop issues
#133解决android-Ultra-Pull-To-Refresh下拉刷新组件中嵌套ViewPager的一个bug42 comments · 2015-08-01#118能否把底部加载更多整合进来?16 comments · 2015-07-06#282需要支持右滑的同志,请看这里,有解决方案12 comments · 2016-12-23#132在ViewPager中嵌套Ptr,水平滑动的时候很容易触发下拉11 comments · 2015-07-30#27it can't be compatible with RecyclerView10 comments · 2015-01-04#105RecyclerView demo9 comments · 2015-06-10#91RentalsSunHeaderView与disableWhenHorizontalMove有冲突9 comments · 2015-06-02#29希望增加固定头部的配置9 comments · 2015-01-07
Latest release
1.0.11 1.0.11 2015-09-19Fix some memory leaks.