car/src/main/java/androidx/car/moderator/SpeedBumpController.java
private void showLockOutMessage() {
        // If the message is visible, then it's already showing or animating in. So, do nothing.
        if (mLockoutMessageView.getVisibility() == View.VISIBLE) {
            return;
        }

        Animation lockOutMessageIn =
                AnimationUtils.loadAnimation(mContext, R.anim.lock_out_message_in);
        lockOutMessageIn.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
                mLockoutMessageView.setVisibility(View.VISIBLE);
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                // When the lock-out message is completely shown, let it display for
                // mLockOutMessageDurationMs milliseconds before hiding it.
                mHandler.postDelayed(SpeedBumpController.this::hideLockOutMessage,
                        mLockOutMessageDurationMs);
            }

            @Override
            public void onAnimationRepeat(Animation animation) {}
        });

        mLockoutMessageView.clearAnimation();
        mLockoutMessageView.startAnimation(lockOutMessageIn);
        ((AnimatedVectorDrawable) mLockoutImageView.getDrawable()).start();
    }
/**
     * Displays a message that informs the user that they are not permitted to interact any further
     * with the current view.
     */
Displays a message that informs the user that they are not permitted to interact any further
with the current view.
Displays a message that informs the user that they are not permitted to interact any further with the current view .
private void showLockOutMessage() {
        if (mLockoutMessageView.getVisibility() == View.VISIBLE) {
            return;
        }
        Animation lockOutMessageIn =
                AnimationUtils.loadAnimation(mContext, R.anim.lock_out_message_in);
        lockOutMessageIn.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
                mLockoutMessageView.setVisibility(View.VISIBLE);
            }
            @Override
            public void onAnimationEnd(Animation animation) {
                mHandler.postDelayed(SpeedBumpController.this::hideLockOutMessage,
                        mLockOutMessageDurationMs);
            }
            @Override
            public void onAnimationRepeat(Animation animation) {}
        });
        mLockoutMessageView.clearAnimation();
        mLockoutMessageView.startAnimation(lockOutMessageIn);
        ((AnimatedVectorDrawable) mLockoutImageView.getDrawable()).start();
    }
private void showLockOutMessage ( ) { if ( mLockoutMessageView . getVisibility ( ) == View . VISIBLE ) { return ; } Animation lockOutMessageIn = AnimationUtils . loadAnimation ( mContext , R . anim . lock_out_message_in ) ; lockOutMessageIn . setAnimationListener ( new Animation . AnimationListener ( ) { @ Override public void onAnimationStart ( Animation animation ) { mLockoutMessageView . setVisibility ( View . VISIBLE ) ; } @ Override public void onAnimationEnd ( Animation animation ) { mHandler . postDelayed ( SpeedBumpController . this :: hideLockOutMessage , mLockOutMessageDurationMs ) ; } @ Override public void onAnimationRepeat ( Animation animation ) { } } ) ; mLockoutMessageView . clearAnimation ( ) ; mLockoutMessageView . startAnimation ( lockOutMessageIn ) ; ( ( AnimatedVectorDrawable ) mLockoutImageView . getDrawable ( ) ) . start ( ) ; }
Displays a message that informs the user that they are not permitted to interact any further
 with the current view.
Displays a message that informs the user that they are not permitted to interact any further with the current view .
// If the message is visible, then it's already showing or animating in. So, do nothing. // When the lock-out message is completely shown, let it display for // mLockOutMessageDurationMs milliseconds before hiding it.