GithubHelp home page GithubHelp logo

Comments (6)

yuyashuai avatar yuyashuai commented on August 27, 2024

请重新引入implementation 'com.yuyashuai.frameanimation:frameanimation:2.1.0

from frameanimation.

punxch avatar punxch commented on August 27, 2024

请重新引入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.

yuyashuai avatar yuyashuai commented on August 27, 2024

修改了另一个 bug,然后没有复现出来上面的问题,更新试下。
implementation 'com.yuyashuai.frameanimation:frameanimation:2.1.1

from frameanimation.

punxch avatar punxch commented on August 27, 2024

@yuyashuai
问题还是存在,建了一个简单工程,用于复现上面的问题。你可以试试
https://github.com/punxch/TestFrameAnimation

from frameanimation.

yuyashuai avatar yuyashuai commented on August 27, 2024

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.

punxch avatar punxch commented on August 27, 2024

受教了,非常感谢!

from frameanimation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.