简体   繁体   English

在Android中收听定向动画

[英]Listen to orientation animation in Android

I need a way to check whether the orientation animation has finished completely. 我需要一种方法来检查定向动画是否已完全完成。 This is not related to onConfigurationChanged because that kicks in before the animation .Is there any way to do this? 这与onConfigurationChanged无关,因为它会在动画之前启动。有什么办法可以做到这一点?

I believe what you're looking for is an AnimationListener : 我相信您正在寻找的是AnimationListener

final Animation animation = yourAnimation;
animation.setAnimationListener(new Animation.AnimationListener() {
    @Override
    public void onAnimationStart(Animation animation) {
        // TODO
    }

    @Override
    public void onAnimationEnd(Animation animation) {
        // Animation has finished.
    }

    @Override
    public void onAnimationRepeat(Animation animation) {
        // TODO
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM