Skip to content

Commit

Permalink
Merge pull request #121 from WeiXiaoMin/patch-1
Browse files Browse the repository at this point in the history
解决bug:第一次加载更多时LoadMoreFooter的LayoutParams属性失效
  • Loading branch information
jdsjlzx authored Mar 18, 2017
2 parents b2a3530 + 76547eb commit 898a394
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ public void setLoadMoreFooter(ILoadMoreFooter loadMoreFooter) {
this.mLoadMoreFooter = loadMoreFooter;
mFootView = loadMoreFooter.getFootView();
mFootView.setVisibility(GONE);

//wxm:mFootView inflate的时候没有以RecyclerView为parent,所以要设置LayoutParams
ViewGroup.LayoutParams vlp = mFootView.getLayoutParams();
if (vlp != null) {
mFootView.setLayoutParams(new LayoutParams(vlp));
} else {
mFootView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
}
}

public void setPullRefreshEnabled(boolean enabled) {
Expand Down

0 comments on commit 898a394

Please sign in to comment.