Skip to content

Commit

Permalink
fixbug #462
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadCym committed Nov 3, 2016
1 parent 3bfb902 commit ecf72c2
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public abstract class BaseQuickAdapter<T, K extends BaseViewHolder> extends Recy
private boolean mFirstOnlyEnable = true;
private boolean mOpenAnimationEnable = false;
private boolean mEmptyEnable;
private boolean mIsUseEmpty = true;
private boolean mHeadAndEmptyEnable;
private boolean mFootAndEmptyEnable;
private Interpolator mInterpolator = new LinearInterpolator();
Expand Down Expand Up @@ -370,7 +371,7 @@ public int getmEmptyViewCount() {
public int getItemCount() {
int i = isLoadMore() ? 1 : 0;
int count = mData.size() + i + getHeaderLayoutCount() + getFooterLayoutCount();
if (mData.size() == 0 && mEmptyView != null) {
if (mData.size() == 0 && mEmptyView != null && mIsUseEmpty) {
/**
* setEmptyView(false) and add emptyView
*/
Expand Down Expand Up @@ -840,6 +841,15 @@ public void setEmptyView(boolean isHeadAndEmpty, boolean isFootAndEmpty, View em
mEmptyEnable = true;
}

/**
* Set whether to use empty view
*
* @param isUseEmpty
*/
public void isUseEmpty(boolean isUseEmpty) {
mIsUseEmpty = isUseEmpty;
}

/**
* When the current adapter is empty, the BaseQuickAdapter can display a special view
* called the empty view. The empty view is used to provide feedback to the user
Expand Down

0 comments on commit ecf72c2

Please sign in to comment.