leanback/src/main/java/androidx/leanback/graphics/BoundsRule.java
public void calculateBounds(Rect rect, Rect result) {
        if (left == null) {
            result.left = rect.left;
        } else {
            result.left = doCalculate(rect.left, left, rect.width());
        }

        if (right == null) {
            result.right = rect.right;
        } else {
            result.right = doCalculate(rect.left, right, rect.width());
        }

        if (top == null) {
            result.top = rect.top;
        } else {
            result.top = doCalculate(rect.top, top, rect.height());
        }

        if (bottom == null) {
            result.bottom = rect.bottom;
        } else {
            result.bottom = doCalculate(rect.top, bottom, rect.height());
        }
    }
/**
     * Takes in the current bounds and sets the final values based on the individual rules in the
     * result object.
     *
     * @param rect Represents the current bounds.
     * @param result Represents the final bounds.
     */
Takes in the current bounds and sets the final values based on the individual rules in the
result object.

@param rect Represents the current bounds.
@param result Represents the final bounds.
Takes in the current bounds and sets the final values based on the individual rules in the result object . @param rect Represents the current bounds . @param result Represents the final bounds .
public void calculateBounds(Rect rect, Rect result) {
        if (left == null) {
            result.left = rect.left;
        } else {
            result.left = doCalculate(rect.left, left, rect.width());
        }
        if (right == null) {
            result.right = rect.right;
        } else {
            result.right = doCalculate(rect.left, right, rect.width());
        }
        if (top == null) {
            result.top = rect.top;
        } else {
            result.top = doCalculate(rect.top, top, rect.height());
        }
        if (bottom == null) {
            result.bottom = rect.bottom;
        } else {
            result.bottom = doCalculate(rect.top, bottom, rect.height());
        }
    }
public void calculateBounds ( Rect rect , Rect result ) { if ( left == null ) { result . left = rect . left ; } else { result . left = doCalculate ( rect . left , left , rect . width ( ) ) ; } if ( right == null ) { result . right = rect . right ; } else { result . right = doCalculate ( rect . left , right , rect . width ( ) ) ; } if ( top == null ) { result . top = rect . top ; } else { result . top = doCalculate ( rect . top , top , rect . height ( ) ) ; } if ( bottom == null ) { result . bottom = rect . bottom ; } else { result . bottom = doCalculate ( rect . top , bottom , rect . height ( ) ) ; } }
Takes in the current bounds and sets the final values based on the individual rules in the
 result object.
Takes in the current bounds and sets the final values based on the individual rules in the result object .