Open martinvano opened 8 years ago
@martinvano I have the same problem.I solve it by add some code:
BaseIndicatorController
public void setAnimationStatus(AnimStatus animStatus) {
if (mAnimators == null) {
return;
}
int count = mAnimators.size();
for (int i = 0; i < count; i++) {
Animator animator = mAnimators.get(i);
boolean isRunning = animator.isRunning();
switch (animStatus) {
case START:
if (!isRunning) {
animator.start();
}
break;
case END:
if (isRunning) {
animator.end();
}
break;
case CANCEL:
if (isRunning) {
animator.cancel();
}
if (animator instanceof ValueAnimator) {
((ValueAnimator) animator).removeAllUpdateListeners();
}
animator.removeAllListeners();
break;
}
}
}
From the leak canary report it seems like BallClipRotateIndicator leaks a calling view (and activity afterward). It might be caused by keeping an implicit reference for calling
postInvalidate();
method. Possible fix would be to clean up the reference in ondetachedfromwindow method.