-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
插件的activity默认动画如何跟系统一致 #404
Comments
如果你指的是activity的转场动画,这个问题确实已经有朋友提出过,通过锁定资源id的方式,但我目前的实践是这样的: 第1点的原因,作者也指出了,凡是针对需要传递资源id的系统api,插件框架是无法介入到framework内部的,这也是为啥shadow在实现overridePendingTransition方法时,直接将资源id置为0 第2点的具体方式是修改框架源码,调整overridePendingTransition的实现,根据id转换为资源名称,通过名称到宿主里找同名资源,将(宿主的)资源id传递给overridePendingTransition方法,源码如下示:
当然也可以通过锁定资源id的方式,插件动画资源在系统api中无缝使用。这两种方式的缺点都是需要在宿主中保持转场动画资源的重复拷贝,一定程度上增加了维护的成本,通过引入脚本自动完成冗余拷贝可以去掉上述维护成本。 |
你好,我按照你的方式设置后,进场动画生效了,但是退场动画不生效,请问可能是什么原因导致的呢,资源都有 |
现在的动画跟系统默认的不一致,感觉很奇怪,按照另一个帖子和ShadowActivity里的说明设置了overridePendingTransition引用了系统提供的动画,但是效果不是我想要的,我现在想让它恢复默认的动画,请问作者该怎么做?
The text was updated successfully, but these errors were encountered: