开发者

Custom Animation Object for Transition in Android?

I want to override the default activity transition in Android with something a bit fancier. What I want to do can't be done with the XML set that one would typically use, so I can't use 开发者_高级运维overridePendingTransition because it only accepts integer references to XML-based animation resources.

What I'd like to do instead is create my own object that inherits from Animation and overrides the getTransformation and applyTransformation methods to do my own thing. This much I can do, but I can't seem to find a way to tie this new animation object into the transition. Is there a method like overridePendingTransition that accepts an Animation object? Or am I going about this all wrong?


Currently the job is done by the WindowManagerService, which calls AnimationUtils.loadAnimation. AnimationUtils only loads animation sets from xml resources, so it's not possible to use a customized Animation object.

Hope someone would propose a patch to AOSP that adds support to customized Animation object...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜