本文整理了Java中android.support.v4.widget.SwipeRefreshLayout.setRefreshing()
方法的一些代码示例,展示了SwipeRefreshLayout.setRefreshing()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SwipeRefreshLayout.setRefreshing()
方法的具体详情如下:
包路径:android.support.v4.widget.SwipeRefreshLayout
类名称:SwipeRefreshLayout
方法名:setRefreshing
[英]Notify the widget that refresh state has changed. Do not call this when refresh is triggered by a swipe gesture.
[中]通知小部件刷新状态已更改。当刷卡手势触发刷新时,不要调用此选项。
代码示例来源:origin: aa112901/remusic
@Override
protected void onPostExecute(Void aVoid) {
if (mContext == null)
return;
mAdapter.notifyDataSetChanged();
swipeRefresh.setRefreshing(false);
}
}.execute();
代码示例来源:origin: k9mail/k-9
void progress(final boolean progress) {
fragmentListener.enableActionBarProgress(progress);
if (swipeRefreshLayout != null && !progress) {
swipeRefreshLayout.setRefreshing(false);
}
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
public void finishTask() {
mIsRefreshing = false;
mSwipeRefreshLayout.setRefreshing(false);
mAdapter.notifyDataSetChanged();
}
代码示例来源:origin: rengwuxian/RxJavaSamples
@Override
public void accept(@NonNull List<Item> items) throws Exception {
swipeRefreshLayout.setRefreshing(false);
adapter.setItems(items);
}
}, new Consumer<Throwable>() {
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
protected void finishTask() {
mSwipeRefreshLayout.setRefreshing(false);
mAdapter.notifyDataSetChanged();
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
protected void finishTask() {
mIsRefreshing = false;
mSwipeRefreshLayout.setRefreshing(false);
mAdapter.notifyDataSetChanged();
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
protected void initRefreshLayout() {
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
mSwipeRefreshLayout.post(() -> {
mSwipeRefreshLayout.setRefreshing(true);
loadData();
});
mSwipeRefreshLayout.setOnRefreshListener(() -> mSwipeRefreshLayout.setRefreshing(false));
}
代码示例来源:origin: rengwuxian/RxJavaSamples
@Override
public void accept(@NonNull Throwable throwable) throws Exception {
throwable.printStackTrace();
swipeRefreshLayout.setRefreshing(false);
Toast.makeText(getActivity(), R.string.loading_failed, Toast.LENGTH_SHORT).show();
}
});
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
public void finishTask() {
mSwipeRefreshLayout.setRefreshing(false);
mLiveAppIndexAdapter.notifyDataSetChanged();
mRecyclerView.scrollToPosition(0);
}
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
protected void finishTask() {
mSwipeRefreshLayout.setRefreshing(false);
mIsRefreshing = false;
hideEmptyView();
initRecyclerView();
}
代码示例来源:origin: rengwuxian/RxJavaSamples
@Override
public void accept(@NonNull List<ZhuangbiImage> images) throws Exception {
swipeRefreshLayout.setRefreshing(false);
adapter.setImages(images);
}
}, new Consumer<Throwable>() {
代码示例来源:origin: pockethub/PocketHub
/**
* Called when the data has loaded.
*
* @param newItems The items added to the list.
*/
protected void onDataLoaded(List<Item> newItems) {
if (!isAdded()) {
return;
}
isLoading = false;
swipeLayout.setRefreshing(false);
items.addAll(newItems);
mainSection.update(items);
showList();
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
public void initRefreshLayout() {
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
mSwipeRefreshLayout.setOnRefreshListener(this::loadData);
mSwipeRefreshLayout.post(() -> {
mSwipeRefreshLayout.setRefreshing(true);
loadData();
});
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
protected void initRefreshLayout() {
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
mSwipeRefreshLayout.setOnRefreshListener(this::loadData);
mSwipeRefreshLayout.post(() -> {
mSwipeRefreshLayout.setRefreshing(true);
loadData();
});
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
public void initEmptyView() {
topLayout.setVisibility(View.GONE);
mSwipeRefreshLayout.setRefreshing(false);
mCustomEmptyView.setVisibility(View.VISIBLE);
mRecyclerView.setVisibility(View.GONE);
mCustomEmptyView.setEmptyImage(R.drawable.img_tips_error_load_error);
mCustomEmptyView.setEmptyText("加载失败~(≧▽≦)~啦啦啦.");
SnackbarUtil.showMessage(mRecyclerView, "数据加载失败,请重新加载或者检查网络是否链接");
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
private void initEmptyView() {
mSwipeRefreshLayout.setRefreshing(false);
mCustomEmptyView.setVisibility(View.VISIBLE);
mRecyclerView.setVisibility(View.GONE);
mCustomEmptyView.setEmptyImage(R.drawable.img_tips_error_load_error);
mCustomEmptyView.setEmptyText("加载失败~(≧▽≦)~啦啦啦.");
SnackbarUtil.showMessage(mRecyclerView, "数据加载失败,请重新加载或者检查网络是否链接");
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
protected void finishTask() {
hideEmptyView();
mSwipeRefreshLayout.setRefreshing(false);
mLiveAppIndexAdapter.notifyDataSetChanged();
mRecyclerView.scrollToPosition(0);
}
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
public void initEmptyView() {
mSwipeRefreshLayout.setRefreshing(false);
mCustomEmptyView.setVisibility(View.VISIBLE);
mRecyclerView.setVisibility(View.GONE);
mCustomEmptyView.setEmptyImage(R.drawable.img_tips_error_load_error);
mCustomEmptyView.setEmptyText("加载失败~(≧▽≦)~啦啦啦.");
SnackbarUtil.showMessage(mRecyclerView, "数据加载失败,请重新加载或者检查网络是否链接");
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
public void initEmptyView() {
mSwipeRefreshLayout.setRefreshing(false);
mCustomEmptyView.setVisibility(View.VISIBLE);
mRecyclerView.setVisibility(View.GONE);
mCustomEmptyView.setEmptyImage(R.drawable.img_tips_error_load_error);
mCustomEmptyView.setEmptyText("加载失败~(≧▽≦)~啦啦啦.");
SnackbarUtil.showMessage(mRecyclerView, "数据加载失败,请重新加载或者检查网络是否链接");
}
代码示例来源:origin: pockethub/PocketHub
protected void onDataLoadError(Throwable throwable) {
if (!isAdded()) {
return;
}
isLoading = false;
swipeLayout.setRefreshing(false);
if (throwable != null) {
showError(throwable, getErrorMessage());
showList();
}
}
内容来源于网络,如有侵权,请联系作者删除!