internal virtual void cancelAll(IList <RecyclerView.ViewHolder> viewHolders) { for (int i = viewHolders.Count - 1; i >= 0; i--) { ViewCompat.animate(viewHolders[i].itemView).cancel(); } }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: protected void animateMoveImpl(final android.support.v7.widget.RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) protected internal virtual void animateMoveImpl(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View view = holder.itemView; View view = holder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int deltaX = toX - fromX; int deltaX = toX - fromX; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int deltaY = toY - fromY; int deltaY = toY - fromY; if (deltaX != 0) { ViewCompat.animate(view).translationX(0); } if (deltaY != 0) { ViewCompat.animate(view).translationY(0); } // TODO: make EndActions end listeners instead, since end actions aren't called when // vpas are canceled (and can't end them. why?) // need listener functionality in VPACompat for this. Ick. //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.support.v4.view.ViewPropertyAnimatorCompat animation = android.support.v4.view.ViewCompat.animate(view); ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mMoveAnimations.Add(holder); animation.setDuration(MoveDuration).setListener(new VpaListenerAdapterAnonymousInnerClassHelper3(this, holder, view, deltaX, deltaY, animation)) .start(); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: protected void animateAddImpl(final android.support.v7.widget.RecyclerView.ViewHolder holder) protected internal virtual void animateAddImpl(RecyclerView.ViewHolder holder) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View view = holder.itemView; View view = holder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.support.v4.view.ViewPropertyAnimatorCompat animation = android.support.v4.view.ViewCompat.animate(view); ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mAddAnimations.Add(holder); animation.alpha(1).setDuration(AddDuration).setListener(new VpaListenerAdapterAnonymousInnerClassHelper2(this, holder, view, animation)) .start(); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: protected void animateChangeImpl(final ChangeInfo changeInfo) protected internal virtual void animateChangeImpl(ChangeInfo changeInfo) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.support.v7.widget.RecyclerView.ViewHolder holder = changeInfo.oldHolder; RecyclerView.ViewHolder holder = changeInfo.oldHolder; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View view = holder == null ? null : holder.itemView; View view = holder == null ? null : holder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.support.v7.widget.RecyclerView.ViewHolder newHolder = changeInfo.newHolder; RecyclerView.ViewHolder newHolder = changeInfo.newHolder; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View newView = newHolder != null ? newHolder.itemView : null; View newView = newHolder != null ? newHolder.itemView : null; if (view != null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.support.v4.view.ViewPropertyAnimatorCompat oldViewAnim = android.support.v4.view.ViewCompat.animate(view).setDuration(getChangeDuration()); ViewPropertyAnimatorCompat oldViewAnim = ViewCompat.animate(view).setDuration(ChangeDuration); mChangeAnimations.Add(changeInfo.oldHolder); oldViewAnim.translationX(changeInfo.toX - changeInfo.fromX); oldViewAnim.translationY(changeInfo.toY - changeInfo.fromY); oldViewAnim.alpha(0).setListener(new VpaListenerAdapterAnonymousInnerClassHelper4(this, changeInfo, view, oldViewAnim)) .start(); } if (newView != null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.support.v4.view.ViewPropertyAnimatorCompat newViewAnimation = android.support.v4.view.ViewCompat.animate(newView); ViewPropertyAnimatorCompat newViewAnimation = ViewCompat.animate(newView); mChangeAnimations.Add(changeInfo.newHolder); newViewAnimation.translationX(0).translationY(0).setDuration(ChangeDuration).alpha(1).setListener(new VpaListenerAdapterAnonymousInnerClassHelper5(this, changeInfo, view, newView, newViewAnimation)) .start(); } }
public override void EndAnimations() { int count = mPendingMoves.size(); for (int i = count - 1; i >= 0; i--) { MoveInfo item = mPendingMoves.get(i); View view = item.holder.itemView; ViewCompat.animate(view).cancel(); ViewCompat.setTranslationY(view, 0); ViewCompat.setTranslationX(view, 0); dispatchMoveFinished(item.holder); mPendingMoves.remove(item); } count = mPendingRemovals.size(); for (int i = count - 1; i >= 0; i--) { RecyclerView.ViewHolder item = mPendingRemovals.get(i); dispatchRemoveFinished(item); mPendingRemovals.remove(item); } count = mPendingAdditions.size(); for (int i = count - 1; i >= 0; i--) { RecyclerView.ViewHolder item = mPendingAdditions.get(i); View view = item.itemView; ViewCompat.setAlpha(view, 1); dispatchAddFinished(item); mPendingAdditions.remove(item); } if (!isRunning()) { return; } count = mMoveAnimations.size(); for (int i = count - 1; i >= 0; i--) { RecyclerView.ViewHolder item = mMoveAnimations.get(i); View view = item.itemView; ViewCompat.animate(view).cancel(); ViewCompat.setTranslationY(view, 0); ViewCompat.setTranslationX(view, 0); dispatchMoveFinished(item); mMoveAnimations.remove(item); } count = mRemoveAnimations.size(); for (int i = count - 1; i >= 0; i--) { RecyclerView.ViewHolder item = mRemoveAnimations.get(i); View view = item.itemView; ViewCompat.animate(view).cancel(); ViewCompat.setAlpha(view, 1); dispatchRemoveFinished(item); mRemoveAnimations.remove(item); } count = mAddAnimations.size(); for (int i = count - 1; i >= 0; i--) { RecyclerView.ViewHolder item = mAddAnimations.get(i); View view = item.itemView; ViewCompat.animate(view).cancel(); ViewCompat.setAlpha(view, 1); dispatchAddFinished(item); mAddAnimations.remove(item); } mMoves.clear(); mAdditions.clear(); dispatchAnimationsFinished(); }
public override void endAnimation(RecyclerView.ViewHolder item) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View view = item.itemView; View view = item.itemView; // this will trigger end callback which should set properties to their target values. ViewCompat.animate(view).cancel(); onPreEndAnimation(item); // TODO if some other animations are chained to end, how do we cancel them as well? for (int i = mPendingMoves.Count - 1; i >= 0; i--) { MoveInfo moveInfo = mPendingMoves[i]; if (moveInfo.holder == item) { ViewCompat.setTranslationY(view, 0); ViewCompat.setTranslationX(view, 0); dispatchMoveFinished(item); mPendingMoves.RemoveAt(i); } } endChangeAnimation(mPendingChanges, item); if (mPendingRemovals.Remove(item)) { ViewCompat.setAlpha(view, 1); dispatchRemoveFinished(item); } if (mPendingAdditions.Remove(item)) { ViewCompat.setAlpha(view, 1); dispatchAddFinished(item); } for (int i = mChangesList.Count - 1; i >= 0; i--) { List <ChangeInfo> changes = mChangesList[i]; endChangeAnimation(changes, item); if (changes.Count == 0) { mChangesList.RemoveAt(i); } } for (int i = mMovesList.Count - 1; i >= 0; i--) { List <MoveInfo> moves = mMovesList[i]; for (int j = moves.Count - 1; j >= 0; j--) { MoveInfo moveInfo = moves[j]; if (moveInfo.holder == item) { ViewCompat.setTranslationY(view, 0); ViewCompat.setTranslationX(view, 0); dispatchMoveFinished(item); moves.RemoveAt(j); if (moves.Count == 0) { mMovesList.RemoveAt(i); } break; } } } for (int i = mAdditionsList.Count - 1; i >= 0; i--) { List <RecyclerView.ViewHolder> additions = mAdditionsList[i]; if (additions.Remove(item)) { ViewCompat.setAlpha(view, 1); dispatchAddFinished(item); if (additions.Count == 0) { mAdditionsList.RemoveAt(i); } } } onPostEndAnimation(item); // animations should be ended by the cancel above. if (mRemoveAnimations.Remove(item) && DEBUG) { throw new System.InvalidOperationException("after animation is cancelled, item should not be in " + "mRemoveAnimations list"); } if (mAddAnimations.Remove(item) && DEBUG) { throw new System.InvalidOperationException("after animation is cancelled, item should not be in " + "mAddAnimations list"); } if (mChangeAnimations.Remove(item) && DEBUG) { throw new System.InvalidOperationException("after animation is cancelled, item should not be in " + "mChangeAnimations list"); } if (mMoveAnimations.Remove(item) && DEBUG) { throw new System.InvalidOperationException("after animation is cancelled, item should not be in " + "mMoveAnimations list"); } dispatchFinishedWhenDone(); }