Custom animation object for transition to Android?

I want to override the default activity transition in Android with something more fun. What I want to do cannot be done with the XML set that is commonly used, so I cannot use overridePendingTransitionit because it only accepts whole links to XML-based animation resources.

Instead, I would like to create my own object that inherits from Animationand overrides methods getTransformationand applyTransformationto do something of my own. I can do this, but I cannot find a way to associate this new animation object with a transition. Is there a method like overridePendingTransitionthat takes an Animation object? Or am I all about this wrong?

+3
source share
1 answer

Currently, work is being done with help WindowManagerServicethat calls AnimationUtils.loadAnimation. AnimationUtilsonly loads animated sets from xml resources, so it’s not possible to use a custom Animation object.

Hope someone offers a patch for AOSP that adds support for a custom Animation object ...

+1
source

Source: https://habr.com/ru/post/1771008/


All Articles