Skip to content

This project aims to make Android-PullToRefresh library support custom animation by GIF file.

License

Notifications You must be signed in to change notification settings

LiuJQ/Android-PullToRefresh-Extention

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 31, 2015
a0ad0bd · Aug 31, 2015

History

7 Commits
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015
Aug 31, 2015

Repository files navigation

Android-PullToRefresh-Extention

What to do ?

This project aims to make Android-PullToRefresh library support custom animation by GIF file.

What does it looks like ?

As we can see from Android-PullToRefresh, the library provides two animations for us, one is FLIP, another is ROTATE, just like below:

BUT now we want to replace the FLIP or ROTATE PNG file with our GIF file. just like below:

How to realize ?

Thanks to this GifView library, we don't need to do too much thing, Oh yeah ^_^.
Just like FlipLoadingLayout and RotateLoadingLayout, I create a GifLoadingLayout and place the GifView in it, just like what you can see in the project.

How to use ?

Previously, we use Android-PullToRefresh library like this:

<com.handmark.pulltorefresh.library.PullToRefreshListView
            xmlns:ptr="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            ptr:ptrAnimationStyle="flip"
            ptr:ptrDrawable="@drawable/ptr_drawable"
            ptr:ptrHeaderBackground="@color/yx_background_eae"
            ptr:ptrHeaderSubTextColor="@color/yx_textcolor_7d7"
            ptr:ptrHeaderTextColor="@color/yx_textcolor_7d7"
            ptr:ptrMode="both" />

Now, we just need to change something like below:

<com.handmark.pulltorefresh.library.extras.GifPullToRefreshListView
            xmlns:ptr="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            ptr:ptrAnimationStyle="gif"
            ptr:ptrDrawable="@drawable/pull_to_refresh_git_progress"
            ptr:ptrHeaderBackground="@color/yx_background_eae"
            ptr:ptrHeaderTextAppearance="?android:attr/textAppearanceSmall"
            ptr:ptrHeaderSubTextColor="@color/yx_textcolor_7d7"
            ptr:ptrHeaderTextColor="@color/yx_textcolor_7d7"
            ptr:ptrMode="both"
            ptr:ptrGifResource="@raw/loading_animation"
            ptr:ptrGifPaused="false" />

Extras

Commits and Feedbacks are warmly welcome !
Email: liujianqiao39870@gmail.com

About

This project aims to make Android-PullToRefresh library support custom animation by GIF file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages