Git Product home page Git Product logo

Comments (2)

YoKeyword avatar YoKeyword commented on May 28, 2024

嗯 确实,在复杂Fragment页面,第一次start该Fragment时,动画会卡。
不管是通过事务的setCustomAnimations() 还是Fragment的onCreateAnimation() 这几种设置转场动画方式都有这个问题。

生命周期顺序:onCreate -> onCreateView -> onCreateAnimation -> onActivityCreated

有种思路是给EnterAnim设置监听方法,在动画结束后再初始化View逻辑和请求异步数据(只在onCreateView里初始化Toolbar的标题等少量控件,避免动画过程中的Fragment页面是空白)

稍晚一会我会push针对这个问题的commit,添加回调EnterAnimation动画结束的方法

from fragmentation.

YoKeyword avatar YoKeyword commented on May 28, 2024

@duchengzhen 已更新,请pull最新的代码; 用例演示见:Demo的 DetailFragment

表现完美,在onCreateView里进行一些初始化toolbar、显示加载进度条等简单UI任务,在onEnterAnimationEnd()里进行复杂UI任务(比如FragmentPagerAdapter等等)

最后感谢你的反馈哈 :)

from fragmentation.

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.