car/src/main/java/androidx/car/app/CarAlertDialog.java
private void updateButtonSpacing() {
        int marginEnd;

        // If both buttons are visible, then there needs to be spacing between them.
        if ((mPositiveButton.getVisibility() == View.VISIBLE
                && mNegativeButton.getVisibility() == View.VISIBLE)) {
            marginEnd = mButtonSpacing;
        } else {
            marginEnd = 0;
        }

        ViewGroup.MarginLayoutParams layoutParams =
                (ViewGroup.MarginLayoutParams) mPositiveButton.getLayoutParams();
        layoutParams.setMarginEnd(marginEnd);
        mPositiveButton.requestLayout();
    }
/**
     * Checks if spacing should be added between the positive and negative button. The spacing is
     * only needed if both buttons are visible.
     */
Checks if spacing should be added between the positive and negative button. The spacing is
only needed if both buttons are visible.
Checks if spacing should be added between the positive and negative button . The spacing is only needed if both buttons are visible .
private void updateButtonSpacing() {
        int marginEnd;
        if ((mPositiveButton.getVisibility() == View.VISIBLE
                && mNegativeButton.getVisibility() == View.VISIBLE)) {
            marginEnd = mButtonSpacing;
        } else {
            marginEnd = 0;
        }
        ViewGroup.MarginLayoutParams layoutParams =
                (ViewGroup.MarginLayoutParams) mPositiveButton.getLayoutParams();
        layoutParams.setMarginEnd(marginEnd);
        mPositiveButton.requestLayout();
    }
private void updateButtonSpacing ( ) { int marginEnd ; if ( ( mPositiveButton . getVisibility ( ) == View . VISIBLE && mNegativeButton . getVisibility ( ) == View . VISIBLE ) ) { marginEnd = mButtonSpacing ; } else { marginEnd = 0 ; } ViewGroup . MarginLayoutParams layoutParams = ( ViewGroup . MarginLayoutParams ) mPositiveButton . getLayoutParams ( ) ; layoutParams . setMarginEnd ( marginEnd ) ; mPositiveButton . requestLayout ( ) ; }
Checks if spacing should be added between the positive and negative button.
Checks if spacing should be added between the positive and negative button .
// If both buttons are visible, then there needs to be spacing between them.