code: private void initMarginRect(Rect marginRect, MarginLayoutParams marginLayoutParams) {
        marginRect.set(
          marginLayoutParams.leftMargin,
          marginLayoutParams.topMargin,
          marginLayoutParams.rightMargin,
          marginLayoutParams.bottomMargin
      );
    }
docs: Converts {@link MarginLayoutParams} into a representative {@link Rect}.
  
  @param marginRect Rect to be initialized with margins coordinates, where
  {@link MarginLayoutParams#leftMargin} is equivalent to {@link Rect#left}, etc.
  @param marginLayoutParams margins to populate the Rect with