Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Pinned sections are destroyed prematurely when a divider is specified for the PSListView, causing a jitter of the header #37

Open
littledot opened this issue Feb 27, 2014 · 0 comments

Comments

@littledot
Copy link

Because of the way ListView handles scrolling, an OnScrollListener increments firstVisibleItem as soon as a child view's getBottom() exceeds the ListView's top boundaries. Vice versa, it decrements firstVisibleItem when a child view's getBottom() is within the ListView's top boundaries.

Now consider the case of a ListView with a divider.

<PinnedSectionListView
        android:divider="@android:color/transparent"
        android:dividerHeight="8dp" />

All items other than the first item will have a spacing of 8dp above itself. However, ensureShadowForPosition() will recreate the header as soon as the positions don't match and set mTranslateY to 0, causing the newly created header to stick to the top when there should be a divider spacing, causing the header to suddenly "jump" to the top.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant