Package 

Object Shapes


  • 
    public class Shapes
    
                        

    Houses utilities for creating Shapes.

    • Method Detail

      • roundedCornerShape

         final CorneredShape roundedCornerShape(Integer topLeftPercent, Integer topRightPercent, Integer bottomRightPercent, Integer bottomLeftPercent)

        Creates a Shape with all corners rounded.

        Parameters:
        topLeftPercent - the top-left corner radius (in percent).
        topRightPercent - the top-right corner radius (in percent).
        bottomRightPercent - the bottom-right corner radius (in percent).
        bottomLeftPercent - the bottom-left corner radius (in percent).
      • cutCornerShape

         final CorneredShape cutCornerShape(Integer topLeftPercent, Integer topRightPercent, Integer bottomRightPercent, Integer bottomLeftPercent)

        Creates a Shape with all corners cut.

        Parameters:
        topLeftPercent - the top-left corner radius (in percent).
        topRightPercent - the top-right corner radius (in percent).
        bottomRightPercent - the bottom-right corner radius (in percent).
        bottomLeftPercent - the bottom-left corner radius (in percent).
      • drawableShape

         final Shape drawableShape(Drawable drawable, Boolean tintDrawable, Boolean keepAspectRatio, Shape otherShape)

        Creates a Shape out of a Drawable.

        Parameters:
        drawable - the Drawable that will be used as a shape.
        keepAspectRatio - whether to keep the drawable’s aspect ratio, based on its intrinsic size.
        otherShape - used to fill the remaining space if the drawable doesn’t fill the entire bounds.