Class RoundedSquareTransform

  • All Implemented Interfaces:
    com.squareup.picasso.Transformation

    public class RoundedSquareTransform
    extends java.lang.Object
    implements com.squareup.picasso.Transformation
    A transformation that rounds a square image to have rounded corners.
    • Constructor Summary

      Constructors 
      Constructor Description
      RoundedSquareTransform​(int radius)
      Constructs a new RoundedSquareTransform with the given radius for the corners.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String key()
      Returns a unique key for the transformation.
      android.graphics.Bitmap transform​(android.graphics.Bitmap source)
      Transforms the given Bitmap to have rounded corners with the radius specified in the constructor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RoundedSquareTransform

        public RoundedSquareTransform​(int radius)
        Constructs a new RoundedSquareTransform with the given radius for the corners.
        Parameters:
        radius - the radius of the corners in pixels
    • Method Detail

      • transform

        public android.graphics.Bitmap transform​(android.graphics.Bitmap source)
        Transforms the given Bitmap to have rounded corners with the radius specified in the constructor.
        Specified by:
        transform in interface com.squareup.picasso.Transformation
        Parameters:
        source - the Bitmap to transform
        Returns:
        the transformed Bitmap with rounded corners
      • key

        public java.lang.String key()
        Returns a unique key for the transformation.
        Specified by:
        key in interface com.squareup.picasso.Transformation
        Returns:
        a String key for the transformation