car/src/main/java/androidx/car/app/CarAlertDialog.java
private void updateButtonPanelVisibility() {
        boolean hasButtons = mPositiveButton.getVisibility() == View.VISIBLE
                || mNegativeButton.getVisibility() == View.VISIBLE;

        int visibility = hasButtons ? View.VISIBLE : View.GONE;

        // Visibility is already correct, so nothing further needs to be done.
        if (mButtonPanel.getVisibility() == visibility) {
            return;
        }

        mButtonPanel.setVisibility(visibility);

        // If there are buttons, then remove the padding at the bottom of the content view.
        int buttonPadding = hasButtons ? 0 : mBottomPadding;
        mContentView.setPaddingRelative(
                mContentView.getPaddingStart(),
                mContentView.getPaddingTop(),
                mContentView.getPaddingEnd(),
                buttonPadding);
    }
/**
     * Toggles whether or not the panel containing the action buttons are visible depending on if
     * a button should be shown.
     */
Toggles whether or not the panel containing the action buttons are visible depending on if
a button should be shown.
Toggles whether or not the panel containing the action buttons are visible depending on if a button should be shown .
private void updateButtonPanelVisibility() {
        boolean hasButtons = mPositiveButton.getVisibility() == View.VISIBLE
                || mNegativeButton.getVisibility() == View.VISIBLE;
        int visibility = hasButtons ? View.VISIBLE : View.GONE;
        if (mButtonPanel.getVisibility() == visibility) {
            return;
        }
        mButtonPanel.setVisibility(visibility);
        int buttonPadding = hasButtons ? 0 : mBottomPadding;
        mContentView.setPaddingRelative(
                mContentView.getPaddingStart(),
                mContentView.getPaddingTop(),
                mContentView.getPaddingEnd(),
                buttonPadding);
    }
private void updateButtonPanelVisibility ( ) { boolean hasButtons = mPositiveButton . getVisibility ( ) == View . VISIBLE || mNegativeButton . getVisibility ( ) == View . VISIBLE ; int visibility = hasButtons ? View . VISIBLE : View . GONE ; if ( mButtonPanel . getVisibility ( ) == visibility ) { return ; } mButtonPanel . setVisibility ( visibility ) ; int buttonPadding = hasButtons ? 0 : mBottomPadding ; mContentView . setPaddingRelative ( mContentView . getPaddingStart ( ) , mContentView . getPaddingTop ( ) , mContentView . getPaddingEnd ( ) , buttonPadding ) ; }
Toggles whether or not the panel containing the action buttons are visible depending on if
 a button should be shown.
Toggles whether or not the panel containing the action buttons are visible depending on if a button should be shown .
// Visibility is already correct, so nothing further needs to be done. // If there are buttons, then remove the padding at the bottom of the content view.