/** * Animates all the cards displayed out of the screen. The total skipped classes text view and the * add subject button will also be animated to a 0 alpha. * * @return the estimated duration of the whole animation */ private long animateClearAll() { final long betweenCardsDelay = 80; int size = mSubjectCards.size(); for (int i = 0; i < size; i++) mSubjectCards.get(i).swipeRight(0, betweenCardsDelay * i); long halfDuration = (betweenCardsDelay * size) / 2 + 120; Animator anmtr = AnimatorCreationUtil.ofFloat(mAddButton, "alpha", halfDuration, null, 0); anmtr.setStartDelay(halfDuration); anmtr.start(); anmtr = AnimatorCreationUtil.ofFloat(mTotalAbsencesTextView, "alpha", halfDuration, null, 0); anmtr.setStartDelay(halfDuration); anmtr.start(); return 2 * halfDuration; }
@Override public void setStartDelay(long startDelay) { Animator a = mAnimator.get(); if (a != null) a.setStartDelay(startDelay); }