Comments (6)
请重新引入implementation 'com.yuyashuai.frameanimation:frameanimation:2.1.0
from frameanimation.
请重新引入
implementation 'com.yuyashuai.frameanimation:frameanimation:2.1.0
@yuyashuai 谢谢,这个问题解决啦。不过我注意到还有一个类似的问题,似乎也是和lock有关。
在第一次启动的时候,onProgress不能正常回调完,走到一半就停住了。
2019-07-11 11:14:57.202 30677-30746/com.example.demo E/VoiceFragment: onProgress:[2/26]
2019-07-11 11:14:57.244 30677-30746/com.example.demo E/VoiceFragment: onProgress:[3/26]
2019-07-11 11:14:57.287 30677-30746/com.example.demo E/VoiceFragment: onProgress:[4/26]
2019-07-11 11:14:57.331 30677-30746/com.example.demo E/VoiceFragment: onProgress:[5/26]
2019-07-11 11:14:57.373 30677-30746/com.example.demo E/VoiceFragment: onProgress:[6/26]
2019-07-11 11:14:57.416 30677-30746/com.example.demo E/VoiceFragment: onProgress:[7/26]
2019-07-11 11:14:57.458 30677-30746/com.example.demo E/VoiceFragment: onProgress:[8/26]
2019-07-11 11:14:57.501 30677-30746/com.example.demo E/VoiceFragment: onProgress:[9/26]
2019-07-11 11:14:57.545 30677-30746/com.example.demo E/VoiceFragment: onProgress:[10/26]
2019-07-11 11:14:57.587 30677-30746/com.example.demo E/VoiceFragment: onProgress:[11/26]
2019-07-11 11:14:57.630 30677-30746/com.example.demo E/VoiceFragment: onProgress:[12/26]
2019-07-11 11:14:57.672 30677-30746/com.example.demo E/VoiceFragment: onProgress:[13/26]
2019-07-11 11:14:57.715 30677-30746/com.example.demo E/VoiceFragment: onProgress:[14/26]
2019-07-11 11:14:57.758 30677-30746/com.example.demo E/VoiceFragment: onProgress:[15/26]
2019-07-11 11:14:57.801 30677-30746/com.example.demo E/VoiceFragment: onProgress:[16/26]
2019-07-11 11:14:59.427 23941-23949/? E/ReloadingLock: Finalizing LOCKED Token[shortcuts 2019-07-11 11:14:51.633]
第二次启动Fragment又能正常工作了。
2019-07-11 11:19:59.311 30677-30875/com.example.demo E/VoiceFragment: onProgress:[1/26]
2019-07-11 11:19:59.353 30677-30875/com.example.demo E/VoiceFragment: onProgress:[2/26]
2019-07-11 11:19:59.396 30677-30875/com.example.demo E/VoiceFragment: onProgress:[3/26]
2019-07-11 11:19:59.439 30677-30875/com.example.demo E/VoiceFragment: onProgress:[4/26]
2019-07-11 11:19:59.481 30677-30875/com.example.demo E/VoiceFragment: onProgress:[5/26]
2019-07-11 11:19:59.524 30677-30875/com.example.demo E/VoiceFragment: onProgress:[6/26]
2019-07-11 11:19:59.567 30677-30875/com.example.demo E/VoiceFragment: onProgress:[7/26]
2019-07-11 11:19:59.610 30677-30875/com.example.demo E/VoiceFragment: onProgress:[8/26]
2019-07-11 11:19:59.652 30677-30875/com.example.demo E/VoiceFragment: onProgress:[9/26]
2019-07-11 11:19:59.695 30677-30875/com.example.demo E/VoiceFragment: onProgress:[10/26]
2019-07-11 11:19:59.737 30677-30875/com.example.demo E/VoiceFragment: onProgress:[11/26]
2019-07-11 11:19:59.780 30677-30875/com.example.demo E/VoiceFragment: onProgress:[12/26]
2019-07-11 11:19:59.823 30677-30875/com.example.demo E/VoiceFragment: onProgress:[13/26]
2019-07-11 11:19:59.866 30677-30875/com.example.demo E/VoiceFragment: onProgress:[14/26]
2019-07-11 11:19:59.908 30677-30875/com.example.demo E/VoiceFragment: onProgress:[15/26]
2019-07-11 11:19:59.952 30677-30875/com.example.demo E/VoiceFragment: onProgress:[16/26]
2019-07-11 11:19:59.994 30677-30875/com.example.demo E/VoiceFragment: onProgress:[17/26]
2019-07-11 11:20:00.038 30677-30875/com.example.demo E/VoiceFragment: onProgress:[18/26]
2019-07-11 11:20:00.080 30677-30875/com.example.demo E/VoiceFragment: onProgress:[19/26]
2019-07-11 11:20:00.122 30677-30875/com.example.demo E/VoiceFragment: onProgress:[20/26]
2019-07-11 11:20:00.165 30677-30875/com.example.demo E/VoiceFragment: onProgress:[21/26]
2019-07-11 11:20:00.207 30677-30875/com.example.demo E/VoiceFragment: onProgress:[22/26]
2019-07-11 11:20:00.249 30677-30875/com.example.demo E/VoiceFragment: onProgress:[23/26]
2019-07-11 11:20:00.291 30677-30875/com.example.demo E/VoiceFragment: onProgress:[24/26]
2019-07-11 11:20:00.335 30677-30875/com.example.demo E/VoiceFragment: onProgress:[25/26]
另外我注意到序号是从1开始,到totalFrames-1
结束,看起像是少了一次回调。
from frameanimation.
修改了另一个 bug,然后没有复现出来上面的问题,更新试下。
implementation 'com.yuyashuai.frameanimation:frameanimation:2.1.1
from frameanimation.
@yuyashuai
问题还是存在,建了一个简单工程,用于复现上面的问题。你可以试试
https://github.com/punxch/TestFrameAnimation
from frameanimation.
在onViewCreated
中直接调用的话,可能会存在 TextureView not available的情况,可以在onSurfaceTextureAvailable
的回调中调用。后面会把这个集成进去。
wave_view.surfaceTextureListener=object :TextureView.SurfaceTextureListener {
override fun onSurfaceTextureSizeChanged(p0: SurfaceTexture?, p1: Int, p2: Int) {
}
override fun onSurfaceTextureUpdated(p0: SurfaceTexture?) {
}
override fun onSurfaceTextureDestroyed(p0: SurfaceTexture?): Boolean {
return true
}
override fun onSurfaceTextureAvailable(p0: SurfaceTexture?, p1: Int, p2: Int) {
wave_view.playAnimationFromAssets("voice_entering_wait")
}
}
另外你好像要在最后一帧的时候播放另一个动画,但是如果在最后一帧的瞬间调用播放会无效(嗯..后面有时间也会改下),可以在播放的时候把两个动画合为一个动画。
val paths=mutableListOf<String>()
.apply {
addAll(Util.getPathList(context!!,"voice_entering_wait"))
addAll(Util.getPathList(context!!,"voice_wait"))
}.map {
FrameAnimation.PathData(it,FrameAnimation.PATH_ASSETS)
}
wave_view.playAnimation(paths.toMutableList(),0)
from frameanimation.
受教了,非常感谢!
from frameanimation.
Related Issues (20)
- 可否开放图片压缩选项接口 HOT 1
- 捕获到Native崩溃 HOT 6
- 我想给你提一个功能PR HOT 1
- 播放完一次如何设置不消失 HOT 1
- 比较占内存 HOT 2
- frameanimation:2.3.1 新bug HOT 3
- can't start animation after release这个错误该怎么解决frameanimation:2.3.1 HOT 3
- java.lang.InterruptedException导致动画提前结束 HOT 1
- Dialog帧动画布局位置,show和dismiss瞬间,会有黑块 HOT 4
- PopupWindow中FrameAnimation.RepeatMode.REVERSE_INFINITE
- 使用sd卡片中的图片播放,解析文件过程中出现死循环? HOT 1
- 能设置最后一帧的时间吗
- 支持获取 res/raw 目录下的图片吗?
- 调用了stopAnimationSafely后动画没有停止,还在继续。
- stopAnimation 方法没有效果 HOT 1
- 内存泄露 HOT 11
- 某些手机上保留最后一帧后,锁屏再开屏,保留的最后一帧就消失了
- 设置模式后不会自动重复播放
- 动画播放时间长一点的话 会报native crash
- 请教:使用FrameAnimation引发的FileMAP:OOM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frameanimation.