PinnedHeaderListView icon indicating copy to clipboard operation
PinnedHeaderListView copied to clipboard

Pinned Section Header flickers

Open psocial opened this issue 10 years ago • 2 comments

When scrolling slowly downward (and the new section header moves upward), the newly pinned header flickers out / disappears for a split second showing the old pinned header that it replaced. It quickly flickers back in and is correctly presented. This isn't noticeable generally when scrolling fast.

psocial avatar Mar 24 '14 22:03 psocial

The next scrolling header (soon to become the pinned header) is being hidden and the pinned headerOffset is being reset to 0 BEFORE the scrolling header actually becomes the pinned header. Classic off-by-one bug. The fix is to wait until the pinned header is off the screen (or wait until the scrolling header becomes the pinned header) before hiding the scrolling header & reseting the headerOffset to 0:

PinnedHeaderListView.java:

120:        if (pinnedHeaderHeight >= headerTop && headerTop >= 0) {\n
121:         mHeaderOffset = headerTop - header.getHeight();
122:        } else if (headerTop < 0) {
123:         header.setVisibility(INVISIBLE);
124:        }

btalberg avatar May 19 '14 16:05 btalberg

Hello @btalberg,

  • I just replaced the condition. Now it works perfect now. Thank you.

tneginareb avatar Jun 08 '15 11:06 tneginareb