saulmm / CoordinatorBehaviorExample

2.71k stars 590 forks source link

The ImageView has a bug when we scroll the contents quickly #37

Open edasich opened 7 years ago

edasich commented 7 years ago

screenshot_1499278648 screenshot_1499278662

edasich commented 7 years ago

Hello sir , First of all thank you for creating this really awesome UI but still has bug. I appreciate that if you fix this bug. Thanks in advance.

GalenLeo commented 7 years ago

set com.android.support:design version to 25.0.1

anelfdz commented 6 years ago

I've solved this issue.

In the class AvatarImageBehavior, the method onDependentViewChanged should be changed like this:

@Override
public synchronized boolean onDependentViewChanged(CoordinatorLayout parent, CircleImageView child, View dependency) {
        ...
        if (expandedPercentageFactor < mChangeBehaviorPoint) {
            ....
            child.setX(mStartXPosition - distanceXToSubtract);
            if (distanceYToSubtract > (mStartYPosition - mFinalYPosition) + (mCustomFinalHeight / 2))
                distanceYToSubtract = (mStartYPosition - mFinalYPosition) + (mCustomFinalHeight / 2);
            child.setY(mStartYPosition - distanceYToSubtract);
            ...
      } 
      ...
}
rakeshg147 commented 6 years ago

@anelfdz that solved the problem. Thank you very much.