Giter Site home page Giter Site logo

Comments (5)

XunMengWinter avatar XunMengWinter commented on August 26, 2024

返回动画的机制大致是这样的:通过postDelayed(runnable,1000)让动画1秒后执行,但实际上1秒后该activity已经stop了,所以动画被延迟到了其activity返回时的onStart()后执行,有时候动画的时长较短,会被FirstActivity中的overridePendingTransition()淹没。还有,结束FirstActivity不能用finish,应该使用onBackPressed(),这样才会有返回动画。

from circularanim.

ShineYang avatar ShineYang commented on August 26, 2024

ok  我明白了  谢谢你的解答。

来自阿里邮箱 iPhone版 ------------------原始邮件 ------------------发件人:XunMengWinter [email protected]日期:2016-08-01 10:15:07收件人:XunMengWinter/CircularAnim [email protected]抄送:ShineYang [email protected], Author [email protected]主题:Re: [XunMengWinter/CircularAnim] 在fragment中startActivity有一定几率不出现回退动画 (#18)返回动画的机制大致是这样的:通过postDelayed(runnable,1000)让动画1秒后执行,但实际上1秒后该activity已经stop了,所以动画被延迟到了其activity返回时的onStart()后执行,有时候动画的时长较短,会被FirstActivity中的overridePendingTransition()淹没。还有,结束FirstActivity不能用finish,应该使用onBackPressed(),这样才会有返回动画。


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from circularanim.

vampire184 avatar vampire184 commented on August 26, 2024

返回动画的机制大致是这样的:通过postDelayed(runnable,1000)让动画1秒后执行,但实际上1秒后该activity已经stop了,所以动画被延迟到了其activity返回时的onStart()后执行,有时候动画的时长较短,会被FirstActivity中的overridePendingTransition()淹没。还有,结束FirstActivity不能用finish,应该使用onBackPressed(),这样才会有返回动画。

作者您好,被淹没的这种情况,有没有好的解决办法呢?我在Android10的手机上很容易出现这种问题

from circularanim.

vampire184 avatar vampire184 commented on August 26, 2024

返回动画的机制大致是这样的:通过postDelayed(runnable,1000)让动画1秒后执行,但实际上1秒后该activity已经stop了,所以动画被延迟到了其activity返回时的onStart()后执行,有时候动画的时长较短,会被FirstActivity中的overridePendingTransition()淹没。还有,结束FirstActivity不能用finish,应该使用onBackPressed(),这样才会有返回动画。

我在android10的手机上发现即使启动了第二个界面(非透明),延迟动画依然执行了。貌似不会像之前的系统那样,activity不可见之后,动画不执行。

from circularanim.

vampire184 avatar vampire184 commented on August 26, 2024

我这边修改了源码,把返回动画的那段代码提取成了一个方法,延迟改成了100ms(如果不设置延迟,有一定概率不显示动画,我估计是activity还没有显示好就执行了,导致动画没出来)。然后在onActivityResult中进行调用,这样保证了每次都能够显示返回动画,但是这样以来破坏了整体性,没有之前使用方便了。作者如果有好的方法可以告诉我。

from circularanim.

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.