<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          CommonRefreshLayoutAndroid 下拉刷新、上拉加載

          聯(lián)合創(chuàng)作 · 2023-09-24 08:34

          基于SwipeRefreshLayout下拉刷新、上拉加載。支持所有的AbsListView、RecycleView

          特點(diǎn)

          •  在 layout 中使用,支持 AbsListView 所有的xml屬性

          •  支持自動(dòng)下拉刷新,什么用呢?比如進(jìn)入界面時(shí),只需要調(diào)用 autoRefresh() 方法即可,同時(shí)下拉刷新回調(diào)函數(shù)將會(huì)被調(diào)用。

          •  上拉加載支持自定義 View 或設(shè)置加載文字、動(dòng)畫

          •  輕松設(shè)置 Adapter 空數(shù)據(jù)視圖,默認(rèn)為 TextView 支持更文字,也可自定義 View

          •  對(duì)于簡(jiǎn)單的界面,如只有 ListView 可以繼承 app 包中 Fragment 輕松搞定

          使用

          仔細(xì)看 listSelector 屬性,效果見(jiàn) sample

          <com.mylhyl.prlayout.SwipeRefreshListView xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:id="@+id/swipeRefresh"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:listSelector="@drawable/selector_list"
              tools:context=".app.ListViewXmlFragment" />

          設(shè)置上拉加載,更多方法見(jiàn) IFooterLayout

                  IFooterLayout footerLayout = swipeRefreshListView.getFooterLayout();
                  footerLayout.setFooterText("set自定義加載");
                  footerLayout.setIndeterminateDrawable(getResources().getDrawable(R.drawable.footer_progressbar));

          自定義adapter空數(shù)據(jù)視圖

                  ImageView emptyView = new ImageView(getContext());
                  emptyView.setImageResource(R.mipmap.empty);
                  swipeRefreshGridView.setEmptyView(emptyView);

                  swipeRefreshListView.setEmptyText("數(shù)據(jù)呢?");

          使用Gradle構(gòu)建時(shí)添加一下依賴即可:

          compile 'com.mylhyl:pullrefreshlayout:1.0.0'

          QQ交流群:435173211

          瀏覽 22
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美一区二区三区四区在线视频 | 草草影院在线观看视频 | 麻豆国产精品视频 | 操逼高潮视频 | 午夜操操逼 |