void trySetupSwipeRefresh() { if (mSwipeRefreshLayout != null) { mSwipeRefreshLayout.setColorSchemeResources( R.color.refresh_progress_3, R.color.refresh_progress_2, R.color.refresh_progress_1); // do not use lambda!! mSwipeRefreshLayout.setOnRefreshListener( new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { requestDataRefresh(); } }); } }
public void setRefreshing(boolean refreshing) { if (mSwipeRefreshLayout == null) { return; } if (!refreshing) { // 防止刷新消失太快,让子弹飞一会儿. mSwipeRefreshLayout.postDelayed( new Runnable() { @Override public void run() { if (mSwipeRefreshLayout != null) { mSwipeRefreshLayout.setRefreshing(false); } } }, 1000); } else { mSwipeRefreshLayout.setRefreshing(true); } }
public void setSwipeableChildren( MultiSwipeRefreshLayout.CanChildScrollUpCallback canChildScrollUpCallback) { mSwipeRefreshLayout.setCanChildScrollUpCallback(canChildScrollUpCallback); }
public void setProgressViewOffset(boolean scale, int start, int end) { mSwipeRefreshLayout.setProgressViewOffset(scale, start, end); }