Skip to content

Commit

Permalink
Renamed method enableStickyHeaders()
Browse files Browse the repository at this point in the history
  • Loading branch information
davideas committed Feb 21, 2016
1 parent 6836a03 commit a7f8954
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ public int getSpanSize(int position) {
}
} else if (id == R.id.action_sticky_headers) {
if (mAdapter.areHeadersSticky()) {
mAdapter.disableHeadersSticky();
mAdapter.disableStickyHeaders();
item.setTitle(R.string.sticky_headers);
} else {
mAdapter.enableHeadersSticky(3);
mAdapter.enableStickyHeaders(3);
item.setTitle(R.string.scroll_headers);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,19 +527,19 @@ public boolean areHeadersSticky() {
* how many headers are normally displayed in the RecyclerView. It
* depends by the specific use case.
*/
public void enableHeadersSticky(int maxCachedHeaders) {
setHeadersSticky(true, maxCachedHeaders);
public void enableStickyHeaders(int maxCachedHeaders) {
setStickyHeaders(true, maxCachedHeaders);
}

/**
* Disables the sticky header functionality. Clears the cache and removes the
* {@link StickyHeaderDecoration} from the RecyclerView.
*/
public void disableHeadersSticky() {
setHeadersSticky(false, -1);
public void disableStickyHeaders() {
setStickyHeaders(false, -1);
}

private void setHeadersSticky(boolean headersSticky, int maxCachedHeaders) {
private void setStickyHeaders(boolean headersSticky, int maxCachedHeaders) {
//Add or Remove the sticky headers decoration
if (headersShown && headersSticky) {
this.headersSticky = headersSticky;
Expand Down

0 comments on commit a7f8954

Please sign in to comment.