cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

emptyView not work #436

Open duzechao opened 7 years ago

duzechao commented 7 years ago

`private void updateHelperDisplays() {

    automaticLoadMoreEnabled = false;
    if (mSwipeRefreshLayout != null)
        mSwipeRefreshLayout.setRefreshing(false);
    if (mAdapter == null)
        return;
    /**
     * fixed by jjHesk
     * + empty layout is NONE
     * + getItemCount is zero
     */
    if (!isFirstLoadingOnlineAdapter) {
        isFirstLoadingOnlineAdapter = true;
        if (mAdapter.getAdapterItemCount() == 0) {
            mEmpty.setVisibility(mEmptyView == null ? View.VISIBLE : View.GONE);
        } else if (mEmptyId != 0) {
            implementLoadMorebehavior();
            mEmpty.setVisibility(View.GONE);
        }
    } else {
        //isFirstLoadingOnlineAdapter = false;
        setRefreshing(false);
        implementLoadMorebehavior();
    }
}`

mEmpty.setVisibility(mEmptyView == null ? View.VISIBLE : View.GONE);???