Package com.example.qrgo.utilities
Class RoundedSquareTransform
- java.lang.Object
-
- com.example.qrgo.utilities.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.
-
-
-
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 interfacecom.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 interfacecom.squareup.picasso.Transformation
- Returns:
- a String key for the transformation
-
-