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

Overview
Welcome to follow me on GitHub or Twitter

GitHub: https://github.com/liaohuqiu

Twitter: https://twitter.com/liaohuqiu


Build Status Android Arsenal

中文版文档

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:

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

Comments
  • Contents of listvie in fragment will disapear on scroll

    Contents of listvie in fragment will disapear on scroll

    I have a listview in a framelayout that uses ptr. when I scroll down the upper contents of listview will disappear a screenshot_2015-03-15-11-52-26 1 nd when I try to scroll up the refresh layout comes up

    opened by Sorush-moradisani 17
  • 非常抱歉打扰您,这个项目没有自动包含所需要的依赖吗

    非常抱歉打扰您,这个项目没有自动包含所需要的依赖吗

    从我目前来看 应该是没有自动包含。

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:cube_ptr="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
        <in.srain.cube.views.ptr.PtrFrameLayout
            android:id="@+id/store_house_ptr_frame"
            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:orientation="horizontal"
                android:background="#333333"
                android:clickable="true"
                android:padding="10dp">
    
    
            </LinearLayout>
    
        </in.srain.cube.views.ptr.PtrFrameLayout>
    
    </RelativeLayout>
    
    
    PtrHandler ptrHandler=new PtrHandler() {
                @Override
                public boolean checkCanDoRefresh(PtrFrameLayout ptrFrameLayout, View view, View view1) {
    
                    return PtrDefaultHandler.checkContentCanBePulledDown(ptrFrameLayout, view, view1);
                }
    
                @Override
                public void onRefreshBegin(PtrFrameLayout ptrFrameLayout) {
                    ptrFrameLayout.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            ptrFrameLayout.refreshComplete();
                        }
                    }, 1800);
                }
            };
            ptrFrameLayout.setPtrHandler(ptrHandler);
    

    这是我的代码,并不能下拉刷新 可能是我太笨不能理解 请大神开导下

    opened by turingking 11
  • 当在ptrframlayout外面嵌套个scrollview是,ptr里面的布局就不会不显示

    当在ptrframlayout外面嵌套个scrollview是,ptr里面的布局就不会不显示

    如题,感觉应该是和scrollview里面嵌套listview原理一样,我尝试了下除非给ptrframlayout个固定高度,否则显示不全,想自己重写onmeasure方法,发现 int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); 这样有问题,这样写显示出来高度超级大,求解...

    opened by asdf19910719 8
  • How do I add listview with emptyview?  the PtrFrameLayout only can host 2 elements

    How do I add listview with emptyview? the PtrFrameLayout only can host 2 elements

    <in.srain.cube.views.ptr.PtrClassicFrameLayout
        android:id="@+id/rotate_header_list_view_frame"
        xmlns:cube_ptr="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        cube_ptr:ptr_duration_to_close="200"
        cube_ptr:ptr_duration_to_close_header="1000"
        cube_ptr:ptr_keep_header_when_refresh="true"
        cube_ptr:ptr_pull_to_fresh="false"
        cube_ptr:ptr_ratio_of_header_height_to_refresh="1.2"
        cube_ptr:ptr_resistance="1.7">
    
        <ListView
            android:id="@+id/rotate_header_list_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/primary"
            android:divider="@null"
            android:fadingEdge="none"
            android:listSelector="@android:color/transparent"
            android:paddingLeft="12dp"
            android:paddingRight="12dp"
            android:scrollbarStyle="outsideOverlay"
            android:choiceMode="singleChoice" />
    
        <TextView
            android:id="@+id/empty"
            android:text="empty view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </in.srain.cube.views.ptr.PtrClassicFrameLayout>
    

    the above code is wrong, because PtrFrameLayout only can host 2 elements? what can i do?

    opened by qingfengmy 7
  • 在AppBarLayout里添加layout_scrollFlags,  PtrClassicFrameLayout添加layout_behavior存在冲突

    在AppBarLayout里添加layout_scrollFlags, PtrClassicFrameLayout添加layout_behavior存在冲突

    已解决,感谢@chenshuhong 的回答,测试可用并解决问题。答案见3L

    复现:

    <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:elevation="0dp">
    
            <某个LinearLayout的控件
                android:id="@+id/header_digist_bar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_scrollFlags="scroll|enterAlways"/>
    
        </android.support.design.widget.AppBarLayout>
    
        <in.srain.cube.views.ptr.PtrClassicFrameLayout
            android:id="@+id/ptr_refresh"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/gray_divider_1"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">
    
            <android.support.v7.widget.RecyclerView
                android:id="@+id/recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/primary_color"
                android:dividerHeight="@dimen/dimen_10_dip"
                android:footerDividersEnabled="false"/>
        </in.srain.cube.views.ptr.PtrClassicFrameLayout>
    

    当RecyclerView无数据时,进行上拉操作,会把AppbarLayout里的控件挤上去(这是正常的)。 此时再下拉,AppbarLayout里的childView无法拉出,只有refresh的header出现

    期望结果:无数据时,且AppbarLayout里的子视图未展现完全时,应将AppbarLayout中的子视图下拉至完全,然后再出现下拉刷新的逻辑。

    备注:也可能是我使用姿势的问题,若是我使用上的问题,麻烦告知。

    opened by andyxialm 5
  • [内存泄露] Anonymous runnable causes memory leak

    [内存泄露] Anonymous runnable causes memory leak

    in.srain.cube.views.ptr.PtrFrameLayout$2.this$0 (anonymous class implements java.lang.Runnable)

    使用了LeakCanary,发现PtrFrameLayout中的匿名Runnable持有Activity的引用,造成了内存泄露,望测试.

    opened by chenenyu 5
  • Using header.setPadding in ListFragment

    Using header.setPadding in ListFragment

    Hi! I want to set padding to header, but it does not work.

    Layout:

    <?xml version="1.0" encoding="utf-8"?>
    <in.srain.cube.views.ptr.PtrFrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        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_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"
        cube_ptr:ptr_ratio_of_header_height_to_refresh="1.2"
        cube_ptr:ptr_resistance="1.7">
    
    <ListView
        android:id="@+id/android:list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:divider="@null"
        android:dividerHeight="8dp"
        android:fadingEdge="none"
        android:padding="12dp"
        android:scrollbarStyle="outsideOverlay"
        tools:ignore="overdraw" />
    </in.srain.cube.views.ptr.PtrFrameLayout>
    

    onCreateView in fragment:

     @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.main_fragment_list, container, false);
    
            final StoreHouseHeader header = new StoreHouseHeader(getActivity());
            header.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
            header.setPadding(0, LocalDisplay.dp2px(20), 0, 0);
            header.initWithString(mStringList[0]);
    
            final PtrFrameLayout frame = (PtrFrameLayout) view.findViewById(R.id.store_house_ptr_frame);
    
            frame.setDurationToCloseHeader(3000);
            frame.setHeaderView(header);
            frame.addPtrUIHandler(header);
    
            frame.addPtrUIHandler(new PtrUIHandler() {
    
                private int mLoadTime = 0;
    
                @Override
                public void onUIReset(PtrFrameLayout frame) {
                    mLoadTime++;
                    String string = mStringList[mLoadTime % mStringList.length];
                    header.initWithString(string);
                }
    
                @Override
                public void onUIRefreshPrepare(PtrFrameLayout frame) {
                }
    
                @Override
                public void onUIRefreshBegin(PtrFrameLayout frame) {
    
                }
    
                @Override
                public void onUIRefreshComplete(PtrFrameLayout frame) {
                }
    
                @Override
                public void onUIPositionChange(PtrFrameLayout frame, boolean isUnderTouch, byte status, PtrIndicator ptrIndicator) {
                }
            });
    
            frame.postDelayed(new Runnable() {
                @Override
                public void run() {
                    frame.autoRefresh(false);
                }
            }, 100);
    
            frame.setPtrHandler(new PtrHandler() {
                @Override
                public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
                    return true;
                }
    
                @Override
                public void onRefreshBegin(final PtrFrameLayout frame) {
                    frame.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            frame.refreshComplete();
                        }
                    }, 2000);
                }
            });
    
            return view;
        }
    

    May be I do something wrong? Please help! Thank You!

    opened by Klafe 5
  • android studio cannot render a preview

    android studio cannot render a preview

    AS cannot render a preview when I wrap a view with ultra-ptr it just show this exception:

    java.lang.NullPointerException at in.srain.cube.views.ptr.PtrClassicDefaultHeader.hideRotateView(PtrClassicDefaultHeader.java:114) at in.srain.cube.views.ptr.PtrClassicDefaultHeader.resetView(PtrClassicDefaultHeader.java:109) at in.srain.cube.views.ptr.PtrClassicDefaultHeader.initViews(PtrClassicDefaultHeader.java:64) at in.srain.cube.views.ptr.PtrClassicDefaultHeader.(PtrClassicDefaultHeader.java:37) at in.srain.cube.views.ptr.PtrClassicFrameLayout.initViews(PtrClassicFrameLayout.java:30) at in.srain.cube.views.ptr.PtrClassicFrameLayout.(PtrClassicFrameLayout.java:21) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:379) at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:99) at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:172) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:782) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:385) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:401) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:329) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:333) at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:674) at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:663) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932) at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:663) at com.android.tools.idea.rendering.RenderService.render(RenderService.java:790) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:611) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1900(AndroidLayoutPreviewToolWindowManager.java:81) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:553) at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178) at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:548) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310) at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238) at com.intellij.util.Alarm$Request$1.run(Alarm.java:327) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

    opened by kebbbnnn 5
  • onRefreshBegin never invoked

    onRefreshBegin never invoked

    Hi! onRefreshBegin as well as checkCanDoRefresh are never invoked and thus the refresh action is never actually triggered. I've tested whether the PtrFrameLayout is visible and at the right place in the GUI by setting its background color to green and this way I verified that it is in fact visible. Also I've verified that the corresponding part of my code which sets up the PtrDefaultHandler is invoked correctly, also fine. Here my code, where as the code within the PtrDefaultHandler is never called.

    Log.d("setting up comment closer");
    pullToRefreshLayout.setPtrHandler(new PtrDefaultHandler() {
                @Override
                public void onRefreshBegin(PtrFrameLayout frame) {
                    Log.d("onRefreshBegin");
                    if (slidingLayout != null && slidingLayout.isPanelExpanded()) {
                        slidingLayout.collapsePanel();
                    }
                    pullToRefreshLayout.refreshComplete();
                }
    
                @Override
                public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
                    Log.d("checkCanDoRefresh");
                    return true;
                }
            });
    

    Again, none of the log messages except for the first which verifies that the handler is setup, is ever printed.

    opened by ghost 5
  • sometimes will NullPointerException

    sometimes will NullPointerException

    java.lang.NullPointerException in.srain.cube.views.ptr.PtrFrameLayout.sendCancelEvent(PtrFrameLayout.java:900) in.srain.cube.views.ptr.PtrFrameLayout.updatePos(PtrFrameLayout.java:378) in.srain.cube.views.ptr.PtrFrameLayout.movePos(PtrFrameLayout.java:365) in.srain.cube.views.ptr.PtrFrameLayout.access$400(PtrFrameLayout.java:22) in.srain.cube.views.ptr.PtrFrameLayout$ScrollChecker.run(PtrFrameLayout.java:958)

    opened by fengivy 4
  • Fix A problem with  disableWhenHorizontalMove()

    Fix A problem with disableWhenHorizontalMove()

    如果在默认位置时,手指按下后,小幅度上滑接着下滑,就会出现无法下拉的情况,303行:Math.abs(offsetX) > 3 * Math.abs(offsetY);这里的判断会在非常小的滑动时产生错误的判断,导致mPreventForHorizontal=true 此提交仅供参考.Thanks!

    opened by AckywOw 4
  • 闪退啊

    闪退啊

    2019-09-28 11:17:00.303 28744-28744/com.dongjinyu.teacher E/Minikin: Could not get cmap table size! 2019-09-28 11:17:00.305 28744-28763/com.dongjinyu.teacher E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist! 2019-09-28 11:17:00.323 28744-28770/com.dongjinyu.teacher E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@67a89cd 2019-09-28 11:17:00.424 28744-28744/com.dongjinyu.teacher E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dongjinyu.teacher, PID: 28744 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dongjinyu.teacher/com.dongjinyu.teacher.activity.MainActivity}: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class in.srain.cube.image.CubeImageView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3318) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3429) at android.app.ActivityThread.-wrap12(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7555) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963) Caused by: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class in.srain.cube.image.CubeImageView Caused by: android.view.InflateException: Binary XML file line #23: Error inflating class in.srain.cube.image.CubeImageView Caused by: java.lang.ClassNotFoundException: Didn't find class "in.srain.cube.image.CubeImageView" on path: DexPathList[[zip file "/data/app/com.dongjinyu.teacher-PKA6TonUWxvpayZNkiogUA==/base.apk"],nativeLibraryDirectories=[/data/app/com.dongjinyu.teacher-PKA6TonUWxvpayZNkiogUA==/lib/arm64, /data/app/com.dongjinyu.teacher-PKA6TonUWxvpayZNkiogUA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.view.LayoutInflater.createView(LayoutInflater.java:613) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:801) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.rInflate(LayoutInflater.java:874) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835) at android.view.LayoutInflater.rInflate(LayoutInflater.java:877) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.dongjinyu.teacher.activity.MainActivity.onCreate(MainActivity.java:27) at android.app.Activity.performCreate(Activity.java:7343) at android.app.Activity.performCreate(Activity.java:7333) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1219) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3271) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3429) at android.app.ActivityThread.-wrap12(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7555) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)

    opened by ximenhuangguaduo 1
  • PtrClassicFrameLayout 嵌套RelativeLayout头部被裁减了

    PtrClassicFrameLayout 嵌套RelativeLayout头部被裁减了

    大佬我使用PtrClassicFrameLayout 嵌套一个RelativeLayout ,然后RelativeLayout 里嵌套个RecyclerView,我RecyclerView里还有头布局,当我上滑之后再往下滑动的时候,头布局就少了一半。这个怎么解决呀?当之前套一个RecyclerView时不会出现这种问题。 屏幕快照 2019-09-04 16 15 35 WechatIMG17258_1 jpeg

    opened by BaiMingxu 0
  • 类型转换异常,存在内存泄漏问题

    类型转换异常,存在内存泄漏问题

    https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh/blob/46fdc861243a3d90dca1f5d31f3c82559ee9e4fa/ptr-lib/src/in/srain/cube/views/ptr/PtrFrameLayout.java#L607 相关分析: https://www.jianshu.com/p/c8e691a69086 记一次Android内存泄漏的优化经历

    opened by junbin1011 0
Releases(1.0.11)
Owner
Huqiu Liao
Huqiu Liao
A custom SwipeRefreshLayout to support the pull-to-refresh featrue.RecyclerView,ListView,GridView,NestedScrollView,ScrollView are supported.

SuperSwipeRefreshLayout A custom SwipeRefreshLayout to support the pull-to-refresh featrue.You can custom your header view and footer view. RecyclerVi

Zheng Haibo(莫川) 1.3k Dec 13, 2022
Phoenix Pull-to-Refresh

Phoenix Pull-to-Refresh This project aims to provide a simple and customizable pull to refresh implementation. Made in [Yalantis] (https://yalantis.co

Yalantis 4k Dec 30, 2022
A little more fun for the pull-to-refresh interaction.

Pull-to-Refresh.Tours This project aims to provide a simple and customizable pull to refresh implementation. Check this [project on Behance] (https://

Yalantis 1.7k Dec 24, 2022
a custom pull-to-refresh layout which contains a interesting animation

This is a project with custom pull-to-refresh layout which contains a interesting animation. And the animation is inspired by https://dribbble.com/sho

ZhangLei 1.8k Dec 27, 2022
A pull-down-to-refresh layout inspired by Lollipop overscrolled effects

JellyRefreshLayout A pull-down-to-refresh layout inspired by Lollipop overscrolled effects Preview Download Gradle: repositories { maven {

Y.Chen 628 Oct 26, 2022
[UNMAINTAINED]: AndroidMosaicLayout is android layout to display group of views as grid consists of different asymmetric patterns (90 different patterns).

AndroidMosaicLayout AndroidMosaicLayout is android layout to display group of views in more that 90 different patterns. What is AndroidMosaicLayout? I

Adham Enaya 474 Nov 12, 2022
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page

Google Plus Layout Google Plus Layout is a custom layout that support playing animation on child view(s) in a serialize manner like the the main

Ahmed Nammari 224 Nov 25, 2022
An android layout to re-arrange child views via dragging

Android Rearrangeable Layout An android layout to re-arrange child views via dragging Screencast Demo Layout Usage All the child views are draggable o

Raja Sharan Mamidala 273 Nov 25, 2022
A layout to transition between two views using a Floating Action Button as shown in many Material Design concepts

⚠ This library is no longer maintained ⚠️ FABRevealLayout A layout to transition between two views using a Floating Action Button as shown in many Mat

Tomás Ruiz-López 901 Dec 9, 2022
VoronoiView is a view (ViewGroup) that allows you to add and display views inside Voronoi diagram regions.

Vorolay VoronoiView is a view (ViewGroup) that allows you to add and display views inside Voronoi diagram regions. [Voronoi diagram] (https://en.wikip

Daniil Jurjev 918 Dec 4, 2022
A simple customised version of the TextInputLayout from the Android Design Support Library ⌨️

Buffer Text Input Layout (Coming to maven central soon!) This is a simple customisation of the TextInputLayout found in the Design Support Library. Wh

Buffer 988 Nov 24, 2022
Smooth version of Google Support Design AppBarLayout

smooth-app-bar-layout [Deprecated] ================ [DEPRECATED] The issue that is addressed in this library is fixed from support design 26.0.0 or ab

Henry Tao 1.8k Dec 13, 2022
Added support to modify text size and indicator width based on the original TabLayout.

XTabLayout——可修改选中项字体大小和指示器长度的TabLayout XTabLayout是基于design包中的TabLayout进行了功能的扩展,在保留原有功能的基础上,增加了修改选中项字体大小、修改指示器长度以及限制屏幕显示范围内显示的Tab个数。 集成步骤: 1.添加XTabLayo

Kennor 660 Dec 20, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Jan 5, 2023
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.

Please switch to DragView, for the best support, thank you DraggablePanel Download allprojects { repositories { ... maven { url 'https://jitp

Hoàng Anh Tuấn 103 Oct 12, 2022
FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

null 33 Dec 8, 2022
A wave view of android,can be used as progress bar.

WaveView ![Gitter](https://badges.gitter.im/Join Chat.svg) A wave view of android,can be used as progress bar. Screenshot APK demo.apk What can be use

Kai Wang 1.3k Dec 28, 2022