Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在没有网的情况下 去加载更多 那个加载中的进度条一直转圈 我用的是listviewFinal #14

Open
IcerAndroid opened this issue Dec 27, 2016 · 2 comments

Comments

@IcerAndroid
Copy link

No description provided.

@ostea
Copy link

ostea commented Dec 28, 2016

这完全是你自己的代码里控制的,没网的状态你肯定在 callback的时候给 complete了

@IcerAndroid
Copy link
Author

IcerAndroid commented Dec 29, 2016

我用我的方法暂时解决了这个问题,有时间可能会去修改下作者的源码,主要是因为回调的顺序

                            @Override
                           public void onFinish() {
                               super.onFinish();
                               if (page == 1) {
                                   mRefreshLayout.onRefreshComplete();
                               } else {
                                   mListview.onLoadMoreComplete();

                               }
                           }


                           @Override
                           public void onFailed(int code, String message) {
                               if (code == -1) {
                                   EmptyViewUtils.showNetErrorEmpty(mLlEmpty);
                                   new Handler().postDelayed(new Runnable() {
                                       @Override
                                       public void run() {
                                           mListview.showFailUI();
                                       }
                                   }, 100);
                                   mListview.showFailUI();
                               } else {
                                   EmptyViewUtils.showNoDataEmpty(mLlEmpty);
                                   ToastUtils.show(MyApplication.getContext(), message);
                               }
                           }

延迟100ms了 执行了mListview.showFailUI();

源码调用顺序

/**
     * 加载更多
     */
    void executeLoadMore() {
        if(!mLoadMoreLock && mHasLoadMore) {
            if (mOnLoadMoreListener != null) {
                mOnLoadMoreListener.loadMore();
            }
            mLoadMoreLock = true;//上锁
            showLoadingUI();
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants