-
- All Implemented Interfaces:
-
pl.droidsonroids.gif.transforms.Transform
public class CornerRadiusTransform implements Transform
Transform which adds rounded corners.
-
-
Constructor Summary
Constructors Constructor Description CornerRadiusTransform(float cornerRadius)
-
Method Summary
Modifier and Type Method Description voidsetCornerRadius(@FloatRange(from = 0) float cornerRadius)Sets the corner radius to be applied when drawing the bitmap. floatgetCornerRadius()RectFgetBounds()Returns current transform bounds - latest received by onBoundsChange. voidonBoundsChange(Rect bounds)Called by GifDrawable when its bounds changes by onBoundsChange and when transform is associated using setTransform. voidonDraw(Canvas canvas, Paint paint, Bitmap buffer)Called by GifDrawable when its draw is called. -
-
Method Detail
-
setCornerRadius
void setCornerRadius(@FloatRange(from = 0) float cornerRadius)
Sets the corner radius to be applied when drawing the bitmap.
- Parameters:
cornerRadius- corner radius or 0 to remove rounding
-
getCornerRadius
@FloatRange(from = 0) float getCornerRadius()
-
getBounds
@NonNull() RectF getBounds()
Returns current transform bounds - latest received by onBoundsChange.
-
onBoundsChange
void onBoundsChange(Rect bounds)
Called by GifDrawable when its bounds changes by onBoundsChange and when transform is associated using setTransform.In this latter case the latest GifDrawable bounds (empty Rect if they were not set yet).
- Parameters:
bounds- new bounds
-
-
-
-