拉动刷新实现:Pull-to-Refresh.Rentals-Android
jopen
10年前
这个项目的目的提供一个简单和可定制的拉动刷新实现。
<com.yalantis.pulltorefresh.library.PullToRefreshView android:id="@+id/pull_to_refresh" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/list_view" android:divider="@null" android:dividerHeight="0dp" android:layout_width="match_parent" android:layout_height="match_parent" /> </com.yalantis.pulltorefresh.library.PullToRefreshView>
mPullToRefreshView = (PullToRefreshView) findViewById(R.id.pull_to_refresh); mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() { @Override public void onRefresh() { mPullToRefreshView.postDelayed(new Runnable() { @Override public void run() { mPullToRefreshView.setRefreshing(false); } }, REFRESH_DELAY); } });
项目主页:http://www.open-open.com/lib/view/home/1421571041578