Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在xml使用的时候直接赋值会报boolean android.animation.ValueAnimator.isRunning() #4

Open
gdmec07120836 opened this issue Nov 12, 2019 · 0 comments

Comments

@gdmec07120836
Copy link

原因是动画还没初始化就触发了onTextChanged()方法,导致 mAnimator_gone.end();空指针。
解决方法:在 mAnimator_gone.end();之前判空就行,补上代码
/**
* 结束所有动画
*/
private void endAnaimator(){
if (mAnimator_gone == null||mAnimator_visible == null){
return;
}
if (mAnimator_gone.isRunning()){
mAnimator_gone.end();
}
if (mAnimator_visible.isRunning()){
mAnimator_visible.end();
}
}

其实这并不是什么严重的bug,真正使用是并不会出现,只是我测试的时候在XML上赋了值,姑且提个issues。最后,感谢楼主的代码!刚开始用,后续看看体验如何。
还有就是楼主有时间可以更新下代码,适配下androidx!!0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant