/** * Animates given View. * * @param view the View that should be animated. */ private void animateView(int position, View view, Animator[] animators) { if (mAnimationStartMillis == -1) { mAnimationStartMillis = SystemClock.UptimeMillis(); } // ViewHelper.setAlpha(view, 0); view.Alpha = 0; AnimatorSet set = new AnimatorSet(); set.PlayTogether(animators); set.StartDelay = calculateAnimationDelay(position); set.SetDuration(mAnimationDurationMillis); set.Start(); mAnimators.Put(view.GetHashCode(), set); }
/** * Cancels any existing animations for given View. */ ////@NonNull readonly public void cancelExistingAnimation(View view) { int hashCode = view.GetHashCode(); Animator animator = mAnimators.Get(hashCode); if (animator != null) { animator.End(); mAnimators.Remove(hashCode); } }