Skip to content

Commit

Permalink
Fix bug when user scroll content quickly. Closes saulmm#37
Browse files Browse the repository at this point in the history
  • Loading branch information
paolorotolo authored Jan 29, 2018
1 parent c6b3d22 commit 1b0839d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public boolean onDependentViewChanged(CoordinatorLayout parent, CircleImageView
* (1f - expandedPercentageFactor)) + (child.getHeight()/2);

child.setX(mStartXPosition - distanceXToSubtract);

int maxYDistance = (mStartYPosition - mFinalYPosition) + (mCustomFinalHeight / 2);
if (distanceYToSubtract > maxYDistance)
distanceYToSubtract = maxYDistance;

child.setY(mStartYPosition - distanceYToSubtract);

float heightToSubtract = ((mStartHeight - mCustomFinalHeight) * heightFactor);
Expand Down

0 comments on commit 1b0839d

Please sign in to comment.