[英]wait for animation to complete and then execute the code
我正在使用自定義動畫庫。
放大動畫效果很好
YoYo.with(Techniques.ZoomIn).duration(700).playOn(retView);
但是,當要從列表視圖(也從sqlite)中刪除行時,項目將被刪除而沒有縮小動畫。 當我刪除要刪除的代碼時,我可以看到縮小動畫。
public void onClick(View v) {
Log.d("HirakDebug", "tCA delete button pressed");
String row = row_id;
YoYo.with(Techniques.ZoomOut).duration(700).playOn(retView);
taskslist.closeAnimate(pos);
tasksDatabaseOperations.deleteItemWithTask(row_id);
adapter.notifyDataSetChanged();
cursor.requery();
}
如何完成第一個動畫然后刪除呢?
You could try the follow, calling the delete methods after the animation has ended. YoYo.with(Techniques.ZoomOut) .withListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { } @Override public void onAnimationEnd(Animator animation) { } @Override public void onAnimationCancel(Animator animation) { } @Override public void onAnimationRepeat(Animator animation) { } }) .duration(700) .playOn(retView);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.