Skip to content

Commit

Permalink
Support negative top offset. Fixes emilsjolander#308
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Sjolander committed Jul 12, 2014
1 parent 9360699 commit c0c27fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ public void onClick(View v) {
private void updateHeaderVisibilities() {
int top;
if (mHeader != null) {
top = mHeader.getMeasuredHeight() + (mHeaderOffset != null ? mHeaderOffset : 0);
top = mHeader.getMeasuredHeight() + (mHeaderOffset != null ? mHeaderOffset : 0) + mStickyHeaderTopOffset;
} else {
top = mClippingToPadding ? mPaddingTop : 0;
top = stickyHeaderTop();
}
int childCount = mList.getChildCount();
for (int i = 0; i < childCount; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public void run() {
drawBehindCheckBox.setOnCheckedChangeListener(checkBoxListener);
fastScrollCheckBox = (CheckBox) findViewById(R.id.fast_scroll_checkBox);
fastScrollCheckBox.setOnCheckedChangeListener(checkBoxListener);

stickyList.setStickyHeaderTopOffset(-20);
}

@Override
Expand Down

0 comments on commit c0c27fa

Please sign in to comment.