src/main/java/ru/mail/dondokidon/extensions/View/ActionMode/ActionMode.java
/**
     * Finish action mode work. You can't use this {@link ActionMode} instance
     * again when it is finished.
     */
Finish action mode work. You can't use this  ActionMode instance
again when it is finished.
Finish action mode work . You can ' t use this ActionMode instance again when it is finished .
public void finish(){
        if (!isFinished) {
            isFinished = true;
            triggerOnFinish();
            if (AppearAnimator != null)
                AppearAnimator.cancel();
            Animator DisappearAnimator = mCallback.createDisappearAnimator(ActionModeToolbar);
            if (DisappearAnimator != null) {
                DisappearAnimator.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationCancel(Animator animation) {
                        super.onAnimationCancel(animation);
                        finish();
                    }
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        finish();
                    }
                    private void finish() {
                        target.removeOnLayoutChangeListener(onLayoutChangeListener);
                        ((ViewGroup) ActionModeToolbar.getParent()).removeView(ActionModeToolbar);
                        ActionModeToolbar = null;
                    }
                });
                DisappearAnimator.start();
            } else {
                ActionModeToolbar = null;
                target.removeOnLayoutChangeListener(onLayoutChangeListener);
                ((ViewGroup) ActionModeToolbar.getParent()).removeView(ActionModeToolbar);
            }
        }
    }
public void finish ( ) { if ( ! isFinished ) { isFinished = true ; triggerOnFinish ( ) ; if ( AppearAnimator != null ) AppearAnimator . cancel ( ) ; Animator DisappearAnimator = mCallback . createDisappearAnimator ( ActionModeToolbar ) ; if ( DisappearAnimator != null ) { DisappearAnimator . addListener ( new AnimatorListenerAdapter ( ) { @ Override public void onAnimationCancel ( Animator animation ) { super . onAnimationCancel ( animation ) ; finish ( ) ; } @ Override public void onAnimationEnd ( Animator animation ) { super . onAnimationEnd ( animation ) ; finish ( ) ; } private void finish ( ) { target . removeOnLayoutChangeListener ( onLayoutChangeListener ) ; ( ( ViewGroup ) ActionModeToolbar . getParent ( ) ) . removeView ( ActionModeToolbar ) ; ActionModeToolbar = null ; } } ) ; DisappearAnimator . start ( ) ; } else { ActionModeToolbar = null ; target . removeOnLayoutChangeListener ( onLayoutChangeListener ) ; ( ( ViewGroup ) ActionModeToolbar . getParent ( ) ) . removeView ( ActionModeToolbar ) ; } } }
Finish action mode work.
Finish action mode work .