All Projects → tangnuo → android-Ultra-Pull-To-Refresh-With-Load-More-master

tangnuo / android-Ultra-Pull-To-Refresh-With-Load-More-master

Licence: MIT license
No description or website provided.

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to android-Ultra-Pull-To-Refresh-With-Load-More-master

View Load Retry
这个加载框架有点不一样,针对View进行加载,加载页面还保持了原View的属性,侧重点在灵活,哪里需要加载哪里,加载状态页面完全自定义,无任何限制,针对加载结果可以按需配置对应页面,LeakCanary检测无内存泄漏
Stars: ✭ 119 (+561.11%)
Mutual labels:  refresh
React Native Smartrefreshlayout
基于android SmartRefreshLayout https://github.com/scwang90/SmartRefreshLayout 开发的插件,可提供类似ios的弹性刷新
Stars: ✭ 240 (+1233.33%)
Mutual labels:  refresh
Management
Management Endpoints used to allow insight into your applications
Stars: ✭ 31 (+72.22%)
Mutual labels:  refresh
Tgrefreshoc
弹簧、橡皮筋下拉刷新控件,类似QQ下拉刷新效果,同时支持其他样式
Stars: ✭ 149 (+727.78%)
Mutual labels:  refresh
Mjrefresh
An easy way to use pull-to-refresh.
Stars: ✭ 13,565 (+75261.11%)
Mutual labels:  refresh
react-pullrefresh
Pull to refresh react component.
Stars: ✭ 61 (+238.89%)
Mutual labels:  refresh
Arrowdrawable
纯Paint实现的一个射箭效果,可用作Loading动画。
Stars: ✭ 103 (+472.22%)
Mutual labels:  refresh
vuejs-loadmore
A pull-down refresh and pull-up loadmore scroll component for Vue.js. Vue上拉加载下拉刷新组件
Stars: ✭ 62 (+244.44%)
Mutual labels:  refresh
Shswiperefreshlayout
Android 升级版 SwipeRefreshLayout,支持RecyclerView、ScrollView等大部分组件,下拉刷新(Refresh)和上拉加载(Loadmore),支持自定义HeaderView和FooterView
Stars: ✭ 236 (+1211.11%)
Mutual labels:  refresh
LCRefresh
简单的swift 版的 下拉刷新控件,希望可以给你提供一个思路。
Stars: ✭ 21 (+16.67%)
Mutual labels:  refresh
Listloading
listloading是一个移动端的上拉、下拉加载更多的组件。主要依赖于iscroll.js v5.1.2基础上开发的组件,基础库可以使用jquery.js或者zepto.js操作dom节点,目前我是使用了zepto.js作为基础库操作dom,以jquery插件的形式存在。如果不想以插件方式使用,则只需要把listloading直接移植你需要的库里面就ok啦。listloading主要针对移动端而生,在使用浏览器自带滚动,用户体验很不友好,与Android和ios差别甚远,所以选择iscroll.js,它实现方式是使用css3动画translate 3D 转换来实现滚动效果,transform属性使用硬件加速,性能方法得到很大提高。 https://gtdalp.github.io/widget/listloading/demos/listloading.html
Stars: ✭ 169 (+838.89%)
Mutual labels:  refresh
Smilerefresh
微笑下拉刷新。这是在 SwipeRefreshLayout基础上修改的下拉刷新库。
Stars: ✭ 203 (+1027.78%)
Mutual labels:  refresh
goRefresh
让下拉刷新炫酷起来~轻松接入lottie动画,支持listview recyclerview scrollerview webview 。同时支持listview和recyclerview上拉加载
Stars: ✭ 24 (+33.33%)
Mutual labels:  refresh
React Native Mjrefresh
基于ios MJRefresh https://github.com/CoderMJLee/MJRefresh 开发的插件,可提供自定义的弹性刷新
Stars: ✭ 140 (+677.78%)
Mutual labels:  refresh
EasyRefresher
The refresh control associated with the scroll view.
Stars: ✭ 15 (-16.67%)
Mutual labels:  refresh
Pull To Refresh
ESPullToRefresh is developed and maintained by Vincent Li. If you have any questions or issues in using ESPullToRefresh, welcome to issue. If you want to contribute to ESPullToRefresh, Please submit Pull Request, I will deal with it as soon as possible.
Stars: ✭ 1,591 (+8738.89%)
Mutual labels:  refresh
Flutter easyrefresh
A flutter widget that provides pull-down refresh and pull-up load.
Stars: ✭ 2,989 (+16505.56%)
Mutual labels:  refresh
View-Load-ReTry
这个加载框架有点不一样,针对View进行加载,加载页面还保持了原View的属性,侧重点在灵活,哪里需要加载哪里,加载状态页面完全自定义,无任何限制,针对加载结果可以按需配置对应页面,LeakCanary检测无内存泄漏
Stars: ✭ 116 (+544.44%)
Mutual labels:  refresh
zepto-refresh
实现下拉到底部和上拉到顶部再拉就出现刷新效果
Stars: ✭ 20 (+11.11%)
Mutual labels:  refresh
YanXuanRefresh
仿网易严选下拉刷新动画效果
Stars: ✭ 37 (+105.56%)
Mutual labels:  refresh

Modification

I had made a modification of the Ultra-Pull-to-Refresh library and let it support load-more function. It supports every view as like as pull-to-refresh. All the logic is simulated to the pull-to-refresh and the configurations(resistance, duration etc.) are shared for both load-more and pull-to-refresh. Currently, only the Home page(PtrDemoHomeFragment) and AutoRefresh(WithGridView) page in demo are modified to demonstrate how to use load-more. But the mechanism should be the same as pull-to-refresh.

If your want to this fork, please download this project and import to your IDE manually. The gradle and maven below is not supported by this fort yet.

PS: All the API are not modified. If you have used the origin Ultra-Pull-To-Refresh library, there will be no need to change your code if you move to this fork.

Thank you for Huqiu Liao, who created such a great library. His code was so scalable and made my modification easier.

This fork is just developed and there would be bugs. Please feel free to report me if you found some bugs.

Github: https://github.com/captainbupt

New functions and classes

  • setFooterView: Corresponding to setHeaderView(). You may also need call addPtrUIHandler() after setting the footer view, which is the same mechanism as setting header.
  • PtrHandler2: A complementary of PtrHandler. When using load more function, you should call setPtrHandler(new PtrHandler2()), rather than setPtrHandler(new PtrHandler()).
  • PtrDefaultHandler2: Implemented a default checkCanDoLoadMore() logic. The same mechanism as PtrDefaultHandler.
  • PtrClassicDefaultFooter: Serve as a default footer which is the reverse of the default header.
  • setMode(Mode): The mode is a new feature of this library. By using setMode, you can enable or disable either header or footer. The argument is an enum, you should it like setMode(Mode.BOTH).

Build Status Android Arsenal

中文版文档

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:

<dependency>
    <groupId>in.srain.cube</groupId>
    <artifactId>ultra-ptr</artifactId>
    <type>aar</type>
    <!-- or apklib format, if you want -->
    <!-- <type>apklib</type> -->
    <version>1.0.11</version>
</dependency>

pom.xml, stable version:

<dependency>
    <groupId>in.srain.cube</groupId>
    <artifactId>ultra-ptr</artifactId>
    <type>aar</type>
    <!-- or apklib format, if you want -->
    <!-- <type>apklib</type> -->
    <version>1.0.11</version>
</dependency>

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
<in.srain.cube.views.ptr.PtrFrameLayout
    android:id="@+id/store_house_ptr_frame"
    xmlns:cube_ptr="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    cube_ptr:ptr_resistance="1.7"
    cube_ptr:ptr_ratio_of_header_height_to_refresh="1.2"
    cube_ptr:ptr_duration_to_close="300"
    cube_ptr:ptr_duration_to_close_header="2000"
    cube_ptr:ptr_keep_header_when_refresh="true"
    cube_ptr:ptr_pull_to_fresh="false" >

    <LinearLayout
        android:id="@+id/store_house_ptr_image_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/cube_mints_333333"
        android:clickable="true"
        android:padding="10dp">

        <in.srain.cube.image.CubeImageView
            android:id="@+id/store_house_ptr_image"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </LinearLayout>

</in.srain.cube.views.ptr.PtrFrameLayout>

Or config in java code

// 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.

    This's the the performance of material style in support package v19.

StoreHouse Style

  • Config using string:
// header
final StoreHouseHeader header = new StoreHouseHeader(getContext());
header.setPadding(0, LocalDisplay.dp2px(15), 0, 0);

/**
 * using a string, support: A-Z 0-9 - .
 * you can add more letters by {@link in.srain.cube.views.ptr.header.StoreHousePath#addChar}
 */
header.initWithString('Alibaba');
  • Config using string array from xml:
header.initWithStringArray(R.array.storehouse);

And in res/values/arrays.xml:

<resources>
    <string-array name="storehouse">
        <item>0,35,12,42,</item>
        <item>12,42,24,35,</item>
        <item>24,35,12,28,</item>
        <item>0,35,12,28,</item>
        <item>0,21,12,28,</item>
        <item>12,28,24,21,</item>
        <item>24,35,24,21,</item>
        <item>24,21,12,14,</item>
        <item>0,21,12,14,</item>
        <item>0,21,0,7,</item>
        <item>12,14,0,7,</item>
        <item>12,14,24,7,</item>
        <item>24,7,12,0,</item>
        <item>0,7,12,0,</item>
    </string-array>
</resources>

Process Refresh

There is a PtrHandler, by which you can refresh the data.

public interface PtrHandler {

    /**
     * Check can do refresh or not. For example the content is empty or the first child is in view.
     * <p/>
     * {@link in.srain.cube.views.ptr.PtrDefaultHandler#checkContentCanBePulledDown}
     */
    public boolean checkCanDoRefresh(final PtrFrameLayout frame, final View content, final View header);

    /**
     * When refresh begin
     *
     * @param frame
     */
    public void onRefreshBegin(final PtrFrameLayout frame);
}

An example:

ptrFrame.setPtrHandler(new PtrHandler() {
    @Override
    public void onRefreshBegin(PtrFrameLayout frame) {
        frame.postDelayed(new Runnable() {
            @Override
            public void run() {
                ptrFrame.refreshComplete();
            }
        }, 1800);
    }

    @Override
    public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
        return PtrDefaultHandler.checkContentCanBePulledDown(frame, content, header);
    }
});

Customize

You can add a PtrUIHandler to PtrFrameLayout to implement any UI effect you want.

public interface PtrUIHandler {

    /**
     * When the content view has reached top and refresh has been completed, view will be reset.
     *
     * @param frame
     */
    public void onUIReset(PtrFrameLayout frame);

    /**
     * prepare for loading
     *
     * @param frame
     */
    public void onUIRefreshPrepare(PtrFrameLayout frame);

    /**
     * perform refreshing UI
     */
    public void onUIRefreshBegin(PtrFrameLayout frame);

    /**
     * perform UI after refresh
     */
    public void onUIRefreshComplete(PtrFrameLayout frame);

    public void onUIPositionChange(PtrFrameLayout frame, boolean isUnderTouch, byte status, int oldPosition, int currentPosition, float oldPercent, float currentPercent);
}

Q & A

  • work with ViewPager: disableWhenHorizontalMove()

  • work with LongPressed, setInterceptEventWhileWorking()

Contact & Help

Please fell free to contact me if there is any problem when using the library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].