刷新加载(TwinklingRefreshLayout)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zsp_android_com/article/details/86219557

TwinklingRefreshLayout

布局

<com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout
    android:id="@+id/twinRef"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rvHelp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none" />
</com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>

控件

private TwinklingRefreshLayout twinRef;
private RecyclerView rvHelp;

twinRef = view.findViewById(R.id.twinRef);
rvHelp = view.findViewById(R.id.rvHelp);

刷新

SinaRefreshView headerView = new SinaRefreshView(getContext());
headerView.setArrowResource(R.drawable.right);
headerView.setTextColor(ContextCompat.getColor(getContext(), R.color.fontHint));
twinRef.setHeaderView(headerView);
ProgressLayout headerView = new ProgressLayout(getContext());
twinRef.setHeaderView(headerView);
twinRef.setOverScrollRefreshShow(false);

加载

LoadingView loadingView = new LoadingView(getContext());
twinRef.setBottomView(loadingView);

回弹

BezierLayout headerView = new BezierLayout(getContext());
twinRef.setHeaderView(headerView);
twinRef.setPureScrollModeOn();

猜你喜欢

转载自blog.csdn.net/zsp_android_com/article/details/86219557