public void undo(@NonNull final View view) {
        int position = AdapterViewUtil.getPositionForView(getListViewWrapper(), view);
        mUndoPositions.remove(position);

        View primaryView = mCallback.getPrimaryView(view);
        View undoView = mCallback.getUndoView(view);

        primaryView.setVisibility(View.VISIBLE);

        ObjectAnimator undoAlphaAnimator = ObjectAnimator.ofFloat(undoView, ALPHA, 1f, 0f);
        ObjectAnimator primaryAlphaAnimator = ObjectAnimator.ofFloat(primaryView, ALPHA, 0f, 1f);
        ObjectAnimator primaryXAnimator = ObjectAnimator.ofFloat(primaryView, TRANSLATION_X, primaryView.getWidth(), 0f);

        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(undoAlphaAnimator, primaryAlphaAnimator, primaryXAnimator);
        animatorSet.addListener(new UndoAnimatorListener(undoView));
        animatorSet.start();

        mCallback.onUndo(view, position);
    }
public void undo(@NonNull final View view) {
        int position = AdapterViewUtil.getPositionForView(getListViewWrapper(), view);
        mUndoPositions.remove(position);

        View primaryView = mCallback.getPrimaryView(view);
        View undoView = mCallback.getUndoView(view);

        primaryView.setVisibility(View.VISIBLE);

        ObjectAnimator undoAlphaAnimator = ObjectAnimator.ofFloat(undoView, ALPHA, 1f, 0f);
        ObjectAnimator primaryAlphaAnimator = ObjectAnimator.ofFloat(primaryView, ALPHA, 0f, 1f);
        ObjectAnimator primaryXAnimator = ObjectAnimator.ofFloat(primaryView, TRANSLATION_X, primaryView.getWidth(), 0f);

        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(undoAlphaAnimator, primaryAlphaAnimator, primaryXAnimator);
        animatorSet.addListener(new UndoAnimatorListener(undoView));
        animatorSet.start();

        mCallback.onUndo(view, position);
    }
public void undo ( @ NonNull final View view ) { int position = AdapterViewUtil . getPositionForView ( getListViewWrapper ( ) , view ) ; mUndoPositions . remove ( position ) ; View primaryView = mCallback . getPrimaryView ( view ) ; View undoView = mCallback . getUndoView ( view ) ; primaryView . setVisibility ( View . VISIBLE ) ; ObjectAnimator undoAlphaAnimator = ObjectAnimator . ofFloat ( undoView , ALPHA , 1f , 0f ) ; ObjectAnimator primaryAlphaAnimator = ObjectAnimator . ofFloat ( primaryView , ALPHA , 0f , 1f ) ; ObjectAnimator primaryXAnimator = ObjectAnimator . ofFloat ( primaryView , TRANSLATION_X , primaryView . getWidth ( ) , 0f ) ; AnimatorSet animatorSet = new AnimatorSet ( ) ; animatorSet . playTogether ( undoAlphaAnimator , primaryAlphaAnimator , primaryXAnimator ) ; animatorSet . addListener ( new UndoAnimatorListener ( undoView ) ) ; animatorSet . start ( ) ; mCallback . onUndo ( view , position ) ; }
Performs the undo animation and restores the original state for given {@link android.view.View}.

@param view the parent {@code View} which contains both primary and undo {@code View}s.
Performs the undo animation and restores the original state for given { @link android . view . View } .