简体   繁体   English

CardScrollViewAnimation侦听器?

[英]CardScrollViewAnimation Listener?

I want to implement some small task or call invalidateOptionsMenu(); 我想执行一些小任务或调用invalidateOptionsMenu(); whenever the animation done by mCardScrollView.animate(position, Animation.INSERTION); 只要动画由mCardScrollView.animate(position, Animation.INSERTION); is completed. 完成了。 So i was wondering is there a way to implement this. 所以我想知道是否有办法实现这一目标。

Do i have to write my own animation callback for this? 我是否需要为此编写自己的动画回调?

You can use withEndAction method to perform something you want to when animation is completed successfully. 当动画成功完成时,可以使用withEndAction方法执行所需的操作。

Runnable endAction = new Runnable() {
     public void run() {
         //do something
     }
};

mCardScrollView.animate(position, Animation.INSERTION).withEndAction(endAction);

Hope this helps. 希望这可以帮助。

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

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