davideas/FlexibleAdapter

Wrong scroll animation start delay calculation for first invisible item

Open

#306 opened on Mar 1, 2017

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Java (3,534 stars) (553 forks)batch import
bughelp wanted

Description

There is a problem for scroll animations with start delay for each item. First invisible item has higher delay then next items and as a result second and next items appear before first item. It depends on scroll position so not always can be reproduced. Rather for small invisible items left then long list. See pictures below.

second_item_already_animated

first_item_animated_after_next_items

I think it's becouse of wrong IF condition for "Normal Forward scrolling after max itemOnScreen is reached" in AnimatorAdapter.calculateAnimationDelay(int position) method.

Instead of "if (mMaxChildViews == 0 || visibleItems < numberOfAnimatedItems ||" there should be "if (mMaxChildViews == 0 || visibleItems <= numberOfAnimatedItems ||"

Let me know if I can fork your repository, pull request this fix or you can do it by yourself. Would it be possible to generate new lib release with this fix?

Contributor guide