This project aims to make Android-PullToRefresh library support custom animation by GIF file.
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:
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.
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" />
Commits and Feedbacks are warmly welcome !
Email: [email protected]