mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-26 05:58:09 +00:00
Prevent header decoration from passing NO_POSITION to getHeaderId.
This commit is contained in:
committed by
Greyson Parrelli
parent
8bd89d1e63
commit
6cb359b2d0
@@ -131,13 +131,16 @@ public class StickyHeaderDecoration extends RecyclerView.ItemDecoration {
|
||||
final View child = parent.getChildAt(translatedChildPosition(parent, layoutPos));
|
||||
|
||||
final int adapterPos = parent.getChildAdapterPosition(child);
|
||||
if (adapterPos == RecyclerView.NO_POSITION) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final long key = adapter.getHeaderId(adapterPos);
|
||||
if (key == StickyHeaderAdapter.NO_HEADER_ID) {
|
||||
start = layoutPos + 1;
|
||||
}
|
||||
|
||||
if (adapterPos != RecyclerView.NO_POSITION && ((layoutPos == start && sticky) || hasHeader(parent, adapter, adapterPos))) {
|
||||
if (((layoutPos == start && sticky) || hasHeader(parent, adapter, adapterPos))) {
|
||||
View header = getHeader(parent, adapter, adapterPos).itemView;
|
||||
c.save();
|
||||
final int left = parent.getLeft();
|
||||
|
||||
Reference in New Issue
Block a user