Pull down to refreshing with wave animation
layout:
<scrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@drawable/image" android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent"> <com.dx.waverefresh.lib.WaveRefreshLayout android:id="@+id/contentLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" app:wr_topImageHeight="@dimen/defaultTopImageHeight" app:wr_waveAmplitude="10dp" app:wr_angle="10" app:wr_bgColor="@color/colorWhite" app:wr_speed="6" app:wr_gravity="right"> ... </com.dx.waverefresh.lib.WaveRefreshLayout> </scrollView> then process pull down to refresh gesture in scrollView.
pulling down:
waveRefreshLayout.setBackgroundOffset(p);touch up:
//start refreshing waveRefreshLayout.startLoadingAnimation(); //not trigger refreshing waveRefreshLayout.restoreBackground();stop wave Animation:
waveRefreshLayout.stopLoading();more usage and information see demo.
Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }Add the dependency:
dependencies { compile 'com.github.StevenDXC:DxWaveRefresh:1.0' }