误报“此动画应以 #start() 开始”棉绒警告
“缺少 recycle() 调用”
在将 Android Studio 更新到 Bumblebee 2021.1.1 Patch 2 后,我收到了有关之前实现的动画(准确地说是在 ofInt() 上)的 lint 警告从4.2.1开始。
有趣的是,当我像这样使用它时,我收到警告:
ObjectAnimator.ofInt(progressBar, "progress", 50).apply {
startDelay = 300L
duration = 1500L
start()
}
但是当我将它保存在这样的变量中时,我没有收到警告:
val objectAnimator = ObjectAnimator.ofInt(progressBar, "progress", 50).apply {
startDelay = 300L
duration = 1500L
start()
}
知道为什么会发生这种情况吗?
有什么想法如何解决/防止警告而不将此操作不必要地保存在变量中吗?
"Missing recycle() calls"
I got a lint warning on previously implemented animations (on ofInt() to be precise) after updating Android Studio to Bumblebee 2021.1.1 Patch 2 from 4.2.1.
What's interesting, is that when I use it like this, I get the warning:
ObjectAnimator.ofInt(progressBar, "progress", 50).apply {
startDelay = 300L
duration = 1500L
start()
}
But when I save it in a variable like this, I get no warning:
val objectAnimator = ObjectAnimator.ofInt(progressBar, "progress", 50).apply {
startDelay = 300L
duration = 1500L
start()
}
Any ideas why it's happening?
Any ideas how to resolve/prevent the warning without saving this operation in a variable unnecessarily?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论