Skip to content

Commit

Permalink
Merge branch 'master' of github.com:youlookwhat/ByRecyclerView
Browse files Browse the repository at this point in the history
  • Loading branch information
youlookwhat committed Oct 16, 2022
2 parents 7de1003 + 406d987 commit c7b1e7d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public void onClick(View v) {
postDelayed(new Runnable() {
@Override
public void run() {
mLoadMoreListener.onLoadMore();
if (mLoadMoreListener != null) {
mLoadMoreListener.onLoadMore();
}
}
}, mLoadMoreDelayMillis);
}
Expand All @@ -229,7 +231,9 @@ public void setRefreshing(boolean refreshing) {
postDelayed(new Runnable() {
@Override
public void run() {
mRefreshListener.onRefresh();
if (mRefreshListener != null) {
mRefreshListener.onRefresh();
}
}
}, 300 + mRefreshDelayMillis);
}
Expand Down Expand Up @@ -368,7 +372,9 @@ && isScrollLoad()
postDelayed(new Runnable() {
@Override
public void run() {
mLoadMoreListener.onLoadMore();
if (mLoadMoreListener != null) {
mLoadMoreListener.onLoadMore();
}
}
}, mLoadMoreDelayMillis);
}
Expand Down Expand Up @@ -455,7 +461,9 @@ && isOnTop()
postDelayed(new Runnable() {
@Override
public void run() {
mRefreshListener.onRefresh();
if (mRefreshListener != null) {
mRefreshListener.onRefresh();
}
}
}, 300 + mRefreshDelayMillis);
}
Expand Down Expand Up @@ -813,7 +821,9 @@ private void autoLoadMore(int position) {
postDelayed(new Runnable() {
@Override
public void run() {
mLoadMoreListener.onLoadMore();
if (mLoadMoreListener != null) {
mLoadMoreListener.onLoadMore();
}
}
}, mLoadMoreDelayMillis);
}
Expand Down Expand Up @@ -1423,6 +1433,12 @@ public void destroy() {
mRefreshEnabled = false;
mPreLoadNumber = 1;
mLoadMoreEnabledStatus = 0;
mRefreshListener = null;
mLoadMoreListener = null;
onItemClickListener = null;
onItemLongClickListener = null;
mOnItemChildClickListener = null;
mOnItemChildLongClickListener = null;
if (mHeaderViews != null) {
mHeaderViews.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public List<T> getData() {
}

public T getItemData(int position) {
if (mData != null && mData.size() > 0 && position < mData.size()) {
if (mData != null && mData.size() > 0 && position >= 0 && position < mData.size()) {
return mData.get(position);
}
return null;
Expand Down

0 comments on commit c7b1e7d

Please sign in to comment.