private void trySetupRefresh(View root) { mSwipeRefreshLayout = (MultiSwipeRefreshLayout) root.findViewById(R.id.swipe_refresh_layout); if (mSwipeRefreshLayout != null) { mSwipeRefreshLayout.setColorSchemeResources( R.color.refresh_progress_3, R.color.refresh_progress_2, R.color.refresh_progress_1); mSwipeRefreshLayout.setOnRefreshListener(() -> requestDataRefresh()); } }
public void setRefreshing(boolean refreshing) { if (mSwipeRefreshLayout == null) { return; } if (!refreshing) { mIsRequestDataRefresh = false; // 防止刷新消失太快,让子弹飞一会儿 mSwipeRefreshLayout.postDelayed(() -> mSwipeRefreshLayout.setRefreshing(false), 1000); } else { requestDataRefresh(); } }
private void requestDataRefresh() { mIsRequestDataRefresh = true; mSwipeRefreshLayout.setRefreshing(true); loadData(); };
public void setSwipeableChildren( MultiSwipeRefreshLayout.CanChildScrollUpCallback canChildScrollUpCallback) { mSwipeRefreshLayout.setCanChildScrollUpCallback(canChildScrollUpCallback); }
public void setProgressViewOffset(boolean scale, int start, int end) { mSwipeRefreshLayout.setProgressViewOffset(scale, start, end); }