美文网首页工作生活
波浪下拉刷新

波浪下拉刷新

作者: SimpleFunc | 来源:发表于2019-07-01 19:32 被阅读0次

下拉刷新带波浪动画,显示加载过程

Demo

waverefresh.gif

Usage

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.

Dependency

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'
}



Swift version

相关文章

网友评论

    本文标题:波浪下拉刷新

    本文链接:https://www.haomeiwen.com/subject/pvbncctx.html