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

Already in the pool! #2

Open
salmanit opened this issue Feb 1, 2019 · 2 comments
Open

Already in the pool! #2

salmanit opened this issue Feb 1, 2019 · 2 comments

Comments

@salmanit
Copy link

salmanit commented Feb 1, 2019

有时候快速滑动的时候就挂了。是不是recycle是异步的,2次up事件太短,瞎猜的。
不要这个方法可以不。

java.lang.IllegalStateException: Already in the pool!
at android.util.Pools$SimplePool.release(Pools.java:112)
at android.util.Pools$SynchronizedPool.release(Pools.java:161)
at android.view.VelocityTracker.recycle(VelocityTracker.java:85)
at com.xxx.xxx.player.DispatchLayout.dispatchTouchEvent(DispatchLayout.java:83)

@mikaelzero
Copy link
Owner

recycle肯定是要调用的 必须要回收,暂时想到几个解决方案

  1. 如果动画处于运行状态,则不响应 down 事件,自然不会出现这个问题
  2. 可以把VelocityTracker的初始化的位置修改,这个之前我好像试过有问题
  3. 在recycle的时候,设置velocitytracker 为null

@salmanit
Copy link
Author

手指按下的时候满足if条件,完事往播放器上滑动,mVelocityTracker没有初始化,action_move的时候就空指针了。

image

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

2 participants