Class BackgroundGrid


  • public final class BackgroundGrid
    extends Object
    BackgroundGrid determines what a view looks like without anything in it.
    Since:
    100.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      BackgroundGrid()
      Creates a new instance of BackgroundGrid.
      BackgroundGrid​(int color, int gridLineColor, float gridLineWidth, float gridSize)
      Creates a new instance of BackgroundGrid with the specified color, grid line color, grid line width and grid size.
    • Constructor Detail

      • BackgroundGrid

        public BackgroundGrid()
        Creates a new instance of BackgroundGrid.
        Since:
        100.0.0
      • BackgroundGrid

        public BackgroundGrid​(int color,
                              int gridLineColor,
                              float gridLineWidth,
                              float gridSize)
        Creates a new instance of BackgroundGrid with the specified color, grid line color, grid line width and grid size.
        Parameters:
        color - an integer representing the background color as 0xAARRGGBB
        gridLineColor - an integer representing the grid line color as 0xAARRGGBB
        gridLineWidth - the grid line width in density-independent pixels (dp)
        gridSize - the grid size in density-independent pixels (dp)
        Throws:
        IllegalArgumentException - if gridLineWidth is less than zero
        IllegalArgumentException - if the gridSize is less than or equal to one *
        Since:
        100.0.0
    • Method Detail

      • getColor

        public int getColor()
        Gets the color of the background.
        Returns:
        an integer representing the color as 0xAARRGGBB
        Since:
        100.0.0
      • setColor

        public void setColor​(int argb)
        Sets the color of the background.
        Parameters:
        argb - the color in the format 0xAARRGGBB
        Since:
        100.0.0
      • getGridLineColor

        public int getGridLineColor()
        Gets the background grid line color.
        Returns:
        an integer representing the grid line color as 0xAARRGGBB
        Since:
        100.0.0
      • setGridLineColor

        public void setGridLineColor​(int argb)
        Sets the background grid line color.
        Parameters:
        argb - the color in the format 0xAARRGGBB
        Since:
        100.0.0
      • getGridLineWidth

        public float getGridLineWidth()
        Gets the background grid line width in density-independent pixels (dp).
        Returns:
        the grid line width in dp
        Since:
        100.0.0
      • setGridLineWidth

        public void setGridLineWidth​(float gridLineWidth)
        Sets the background grid line width in density-independent pixels (dp).
        Parameters:
        gridLineWidth - grid line width in dp
        Throws:
        IllegalArgumentException - if the gridLineWidth is less than 0
        Since:
        100.0.0
      • getGridSize

        public float getGridSize()
        Gets the size of each background grid square, in density-independent pixels (dp).
        Returns:
        the grid size in dp
        Since:
        100.0.0
      • setGridSize

        public void setGridSize​(float gridSize)
        Sets the size of each background grid square, in density-independent pixels (dp). The background grid size must be greater than 1.
        Parameters:
        gridSize - grid size in dp
        Throws:
        IllegalArgumentException - if the gridSize is less than or equal to one
        Since:
        100.0.0