AndroidDeveloperLB / LollipopContactsRecyclerViewFastScroller

A sample of how to mimic the way that the contacts app handles a Fast-Scroller for a RecyclerView
Apache License 2.0
540 stars 95 forks source link

Factorize positon computation + Removed ViewTreeObserver #15

Closed darzul closed 8 years ago

darzul commented 8 years ago

There were two places in the code to compute the scrolling position. As it is the same code I factorized it in a method -> setBubbleAndHandlePosition()

In this PR the ViewTreeObserver on RecyclerView is replaced by a call to setBubbleAndHandlePosition() in onSizeChanged(). When the RecyclerViewFastScroller size changes we have to compute the new handle position.

What do you think about these changes ?

AndroidDeveloperLB commented 8 years ago

Nice. So it's only refactoring, right? I'd name the new function differently thought. Maybe "updateBubbleAndHandlePosition". When having a "set", this prefix is usually for setters.

darzul commented 8 years ago

Yes it is. You're right, it's fixed :)

AndroidDeveloperLB commented 8 years ago

ok then. thanks for helping.