• Android ---------- 下拉刷新,上拉加载


    视图布局部分:

    <com.Widget.StateFrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"
    app:dataErrorLayoutResId="@layout/widget_dataerror"
    app:emptyLayoutResId="@layout/widget_dataempty"
    app:loadingLayoutResId="@layout/widget_data_loading"
    app:needLoginLayoutResId="@layout/widget_needlogin"
    app:netErrorLayoutResId="@layout/widget_neterror"
    app:timeOutLayoutResId="@layout/widget_timeout"

    >
    <com.Widget.ASwipeRefreshLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"
    >
    <android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
    </com.Widget.ASwipeRefreshLayout>

    </com.Widget.StateFrameLayout>

    控制器部分:
    // 设置上拉加载更多
    swipelayoutyoudan.setOnLoadMoreListener(new ASwipeRefreshLayout.OnLoadMoreListener() {
    @Override
    public void onLoadMore() {
    pageindex+=1;
    requestData(false);
    }
    });
    //设置下拉刷新
    swipelayoutyoudan.setOnRefreshListener(new ASwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
    pageindex=1;
    requestData(false);
    }
    });




  • 相关阅读:
    小网络的激活函数
    Dual Path Networks
    RT600之Mailbox
    RT600之OTFAD
    RSA算法详解
    RT600之SB
    RT600之master key
    RT600之PUF
    RT600 Boot详解
    RT如何生成image
  • 原文地址:https://www.cnblogs.com/apeandcat/p/8390660.html
Copyright © 2020-2023  润新知