Phoenix Pull-to-Refresh

Overview

Android Arsenal Yalantis

Phoenix Pull-to-Refresh

This project aims to provide a simple and customizable pull to refresh implementation. Made in [Yalantis] (https://yalantis.com/?utm_source=github)

Check this [project on Dribbble] (https://dribbble.com/shots/1650317-Pull-to-Refresh-Rentals)
Check this [project on Behance] (https://www.behance.net/gallery/20411445/Mobile-Animations-Interactions)

alt text

#Usage

For a working implementation, Have a look at the Sample Project - sample

  1. Include the library as local library project.

    compile 'com.yalantis:phoenix:1.2.3'

  2. Include the PullToRefreshView widget in your layout.

    <com.yalantis.phoenix.PullToRefreshView
        android:id="@+id/pull_to_refresh"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <ListView
            android:id="@+id/list_view"
            android:divider="@null"
            android:dividerHeight="0dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    
    </com.yalantis.phoenix.PullToRefreshView>
  3. In your onCreate method refer to the View and setup OnRefreshListener.

    mPullToRefreshView = (PullToRefreshView) findViewById(R.id.pull_to_refresh);
    mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
        @Override
        public void onRefresh() {
            mPullToRefreshView.postDelayed(new Runnable() {
                @Override
                public void run() {
                    mPullToRefreshView.setRefreshing(false);
                }
            }, REFRESH_DELAY);
        }
     });

#Customization

To customize drawables you can change:

  • sun.png - Sun image
  • sky.png - background image
  • buildings.png - foreground image

Misc

If you need to change progress state:

	mPullToRefreshView.setRefreshing(boolean isRefreshing)

#Compatibility

  • Android GINGERBREAD 2.3+

Changelog

Version: 1.2

  • Sample updated with RecyclerView example
  • Showing the refresh view just in it's bounds. (Issue with transparent / empty ListView)
  • Possibility to set refresh view padding

Version: 1.0

  • Initial Build

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for Android (iOS) better than better. Stay tuned!

License

Copyright 2017, Yalantis

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • PullToRefreshLayout is always visible

    PullToRefreshLayout is always visible

    PullToRefreshLayout should be visible only when you start dragging it down. Now it is always visible and I have to set the background of the recyclerView to 100% opacity.

    bug 
    opened by DavidPacioianu 13
  • Integration with observable list view

    Integration with observable list view

    I'm using pull-to-refresh-rentals with observable scroll view (https://github.com/ksoichiro/Android-ObservableScrollView) in my application (the code is almost identical to the StickyHeaderListView sample code in observable-scrollview source code). However the pull to refresh image (the sky and building) gets covered by the toolbars provided by observablescrollview.

    I've played a lot with the padding and layout-margintop of pull-to-refresh but it seems that there is no decent solution for this. I tried to use some code trick to add and remove layout-margin top to pull to refresh but it leads to strange not smooth behavior. Another not-so-good solution is to set the setVisibility of toolbars to VISIBILITY.GONE in onRefresh() but not a very good solution.

    I attached a screenshot of the problem during the pull to refresh action. You can see the two redundant big white spaces (white spaces beneath the toolbars appear during pull to refresh) and also the pictures are covered by toolbars.

    I was wondering if there is a way to make these two libraries work together in peace :)

    opened by jamescategory 6
  • Phoenix doesnt work on Samsung Galaxy S2

    Phoenix doesnt work on Samsung Galaxy S2

    I added Phoenix to my project and it works fine with Sony Xperia. However, I can't scroll to refresh when testing my app on Samsung Galaxy S2. Do you have similar issue on that device? What might be the problem?

    opened by figengungor 5
  • Resource name

    Resource name "type" conflicts with other lib

    I'm not sure, which exactly, but I can't even sync gradle with this lib. Debug values contains following code

    <declare-styleable name="LiveLockScreen"><attr format="string" name="settingsActivity"/><attr name="type">
             <flag name="experience" value="1"/>
             <flag name="event" value="2"/>
         </attr></declare-styleable>
    
    opened by rostopira 4
  • problem when scrolling up

    problem when scrolling up

    i have a problem when try to scroll up as the screenshot

    screenshot_2016-07-16-11-22-57 my xml `

    <com.yalantis.phoenix.PullToRefreshView
        android:id="@+id/pull_to_refresh"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <android.support.v7.widget.RecyclerView
                android:id="@+id/home_recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
    
                />
            <View
                android:id="@+id/home_empty"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@drawable/home"
                android:clickable="false"
                android:visibility="gone"
                />
        </RelativeLayout>
    
    </com.yalantis.phoenix.PullToRefreshView>
    
    </RelativeLayout>
    

    `

    opened by AhmedDonkl 4
  • bug with oom had happen more than 573 in my project

    bug with oom had happen more than 573 in my project

    java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:575) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:410) at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:433) at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:463) at com.yalantis.phoenix.refresh_view.SunRefreshView.createBitmaps(SunRefreshView.java:108) at com.yalantis.phoenix.refresh_view.SunRefreshView.initiateDimens(SunRefreshView.java:104) at com.yalantis.phoenix.refresh_view.SunRefreshView$1.run(SunRefreshView.java:81) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5062) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132) at dalvik.system.NativeStart.main(Native Method)

    基本信息 首次发生时间 最近发生时间 出现次数 版本 2015-11-20 16:16:21 2015-11-24 18:49:33 573 2.2 qq 20151126120534

    bug 
    opened by qq2748 4
  • Size of the Background Animation in Master/Detail Pane Layout

    Size of the Background Animation in Master/Detail Pane Layout

    The thing is that If you are using the Android Studio template for Master/Detail Flow's there is a bug in the sizing of the Background Animation. It seems that your code uses the Device width as the Animation width - but It should use the fragment/activity width instead.

    bildschirmfoto 2015-03-16 um 22 49 52

    I hope you get what I mean.

    bug 
    opened by meierjan 4
  • How can i disable it programatically?

    How can i disable it programatically?

    Hello, is it possible to disable it programatically,because i want it to be active only when specific view is touched and not the rest of the layout?

    Thanks in advance :) Great lib btw !

    opened by svetaz 3
  • Scroll doesn't work with complex layouts

    Scroll doesn't work with complex layouts

    This might be fixed with this PR: https://github.com/Yalantis/Phoenix/pull/31

    If you watch the .gif below, you'll see that I can scroll this ListView down and up if I continue the touch. Once the touch has been lifted from the screen and you swipe down it starts show the refresh view. Normal behavior should not show this unless at the top of the ListView.

    Was this by design?

    phoenixscrollissue

    opened by bradmartin 3
  • can implement pull up and  auto loadmore and multi-fingered

    can implement pull up and auto loadmore and multi-fingered

    can you implement: 1: pull up ,which show need pull up 2:load more, which auto show,can click loadmore and pull up load more 3:multi-fingered pull up and down thanks !

    opened by krmao 3
  • Create view success ,but got a TableNotFoundException when query

    Create view success ,but got a TableNotFoundException when query

    I create a hbase table use create 'pay_psa_info6',{NAME=>'cf'} then load data which exported from online use the shell hbase org.apache.hadoop.hbase.mapreduce.Import pay_psa_info6 /tmp/part-m-00000

    scan the hbase table image

    then I create view CREATE VIEW "pay_psa_info6" (pk VARCHAR PRIMARY KEY, "cf"."c" integer);

    select * from pay_psa_info6; Error: ERROR 1012 (42M03): Table undefined. tableName=PAY_PSA_INFO6 (state=42M03,code=1012) org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=PAY_PSA_INFO6 at org.apache.phoenix.compile.FromCompiler$BaseColumnResolver.createTableRef(FromCompiler.java:577) at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.(FromCompiler.java:391) at org.apache.phoenix.compile.FromCompiler.getResolverForQuery(FromCompiler.java:228) at org.apache.phoenix.compile.FromCompiler.getResolverForQuery(FromCompiler.java:206) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:482) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:456) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:302) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:291) at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:290) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:283) at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1830) at sqlline.Commands.execute(Commands.java:822) at sqlline.Commands.sql(Commands.java:732) at sqlline.SqlLine.dispatch(SqlLine.java:813) at sqlline.SqlLine.begin(SqlLine.java:686) at sqlline.SqlLine.start(SqlLine.java:398) at sqlline.SqlLine.main(SqlLine.java:291)

    opened by adiaixin 2
  • Update project

    Update project

    • Update gradle version
    • Fix gradle issues
    • Update mavenpush.gradle script
    • Update compileSdkVersion
    • Update targetSdkVersion
    • Update buildToolsVersion
    • Migrate to AndroidX
    opened by dmytro1morozov 0
  • OutOfMemoryError

    OutOfMemoryError

    java.lang.OutOfMemoryError: at android.graphics.Bitmap.nativeCreate(Native Method:0) at android.graphics.Bitmap.createBitmap(Bitmap.java:922) at android.graphics.Bitmap.createBitmap(Bitmap.java:895) at android.graphics.Bitmap.createBitmap(Bitmap.java:827) at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:703) at com.yalantis.phoenix.refresh_view.SunRefreshView.createBitmaps(SunRefreshView.java:110) at com.yalantis.phoenix.refresh_view.SunRefreshView.initiateDimens(SunRefreshView.java:102) at com.yalantis.phoenix.refresh_view.SunRefreshView$1.run(SunRefreshView.java:79) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5433) at java.lang.reflect.Method.invokeNative(Native Method:0) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(Native Method:0)

    opened by brucelam 1
Owner
Yalantis
Knowledge is power and the way to get power is by sharing knowledge. We are open source because this is a smart way to live, work and play.
Yalantis
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 to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!

RecyclerRefreshLayout English | 中文版 RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout

dinus_developer 1.7k Nov 10, 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
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
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
Kotlin-phoenix - A set of tools aimed to bridge Phoenix with the Kotlin Multiplatform world

Kotlin Phoenix This project is aimed to allow developers to work with Phoenix Ch

Adrien Jacquier Bret 5 Sep 21, 2022
Ultra Pull to Refresh for Android. Support all the views.

Welcome to follow me on GitHub or Twitter GitHub: https://github.com/liaohuqiu Twitter: https://twitter.com/liaohuqiu 中文版文档 Wanna auto-load-more? This

Huqiu Liao 9.6k Jan 5, 2023
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
This project aims to provide a reusable pull to refresh widget for Android.

Pull To Refresh for Android Note This library is deprecated, a swipe refresh layout is available in the v4 support library. This project aims to provi

Johan Berg 2.5k Jan 2, 2023
Android widget with pull to refresh for all the views,and support loadMore for ListView , RecyclerView, GridView and SwipeRefreshLayout.

CommonPullToRefresh Android widget with pull to refresh for all the views,and support loadMore for ListView,RecyclerView,GridView and SwipeRefreshLayo

null 1.1k Nov 10, 2022
A generic, customizable, open source Android ListView implementation that has 'Pull to Refresh' functionality.

Android 'Pull to Refresh' ListView library Demo video: http://www.youtube.com/watch?v=VjmdELnm3GI Project A generic, customizable, open source Android

Erik Wallentinsen 639 Nov 17, 2022
android custom listview,with interaction pattern load more and pull to refresh to load data dinamically

The first thing that i have to say is render thanks to johannilsson because all the part of pull to refresh listview is based in the code of his repos

Fabian Leon 447 Nov 15, 2022
A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!

RecyclerRefreshLayout English | 中文版 RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout

dinus_developer 1.7k Nov 10, 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
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
Android - An action bar item which acts both as a refresh button and as a progress indicator

RefreshActionItem An action bar item that implements this common pattern: Initially it shows a refresh button. If the button is clicked, a background

Manuel Peinado Gallego 655 Nov 10, 2022
Refresh token Android Retrofit

Refresh Token Sample When multiple requests hit 404 (HTTP_UNAUTHORIZED), only single Refresh token request will be executed. After successful refresh,

Petrus Nguyễn Thái Học 69 Jan 2, 2023