Skip to content

Commit 1b69de2

Browse files
authored
Merge pull request #78 from 8BitDream/master
Respect RecyclerView clipToPadding for bottom
2 parents fdad5ad + 6e410f3 commit 1b69de2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

alphabetsindexfastscrollrecycler/src/main/java/in/myinnos/alphabetsindexfastscrollrecycler/IndexFastScrollRecyclerSection.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,13 @@ private void scrollToPosition() {
245245
public void onSizeChanged(int w, int h, int oldw, int oldh) {
246246
mListViewWidth = w;
247247
mListViewHeight = h;
248-
mIndexbarRect = new RectF(w - mIndexbarMarginLeft - mIndexbarWidth
249-
, mIndexbarMarginTop
250-
, w - mIndexbarMarginRight
251-
, h - mIndexbarMarginBottom);
248+
mIndexbarRect = new RectF(
249+
w - mIndexbarMarginLeft - mIndexbarWidth,
250+
mIndexbarMarginTop,
251+
w - mIndexbarMarginRight,
252+
h - mIndexbarMarginBottom - (mRecyclerView.getClipToPadding()
253+
? 0 : mRecyclerView.getPaddingBottom())
254+
);
252255
}
253256

254257
public void setAdapter(RecyclerView.Adapter adapter) {
@@ -481,4 +484,4 @@ public void setIndexBarHighLightTextVisibility(boolean shown) {
481484
setSetIndexBarHighLightTextVisibility = shown;
482485
}
483486

484-
}
487+
}

0 commit comments

Comments
 (0)