Added in API level 37

RoundedRectBlurRegion


class RoundedRectBlurRegion : BlurRegion
kotlin.Any
   ↳ android.view.BlurRegion
   ↳ android.view.RoundedRectBlurRegion

Defines a rounded rectangular blur region on the SurfaceView.

Summary

Public constructors

Constructs a new RoundedRectBlurRegion with the default parameters.

RoundedRectBlurRegion(rect: RectF, cornerRadii: FloatArray, alpha: Float, blurRadius: Float)

Constructs a new RoundedRectBlurRegion with the specified rounded rectangle coordinates and corner radii.

Public methods
RoundedRectBlurRegion

Returns a deep copy of this blur region.

RectF

Returns the bounds of the blur region.

FloatArray

Returns the corner radii for the blur region.

Unit

Sets the bounds of the blur region.

Unit
setCornerRadii(cornerRadius: Float)

Sets the corner radius for all corners of the blur region.

Unit
setCornerRadii(cornerRadii: FloatArray)

Sets the corner radii for the blur region.

Inherited functions

Public constructors

RoundedRectBlurRegion

Added in API level 37
RoundedRectBlurRegion()

Constructs a new RoundedRectBlurRegion with the default parameters.

The default bounds and all corner radii are 0.0f.

The default alpha is 1.0f and the default blur radius is 0.0f.

RoundedRectBlurRegion

Added in API level 37
RoundedRectBlurRegion(
    rect: RectF,
    cornerRadii: FloatArray,
    alpha: Float,
    blurRadius: Float)

Constructs a new RoundedRectBlurRegion with the specified rounded rectangle coordinates and corner radii.

The cornerRadii values are ordered [topLeftX, topLeftY, topRightX, topRightY, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY].

Parameters
rect RectF: bounds of the blur region.
This value cannot be null.
cornerRadii FloatArray: array of 8 floats representing the corner radii.
This value cannot be null.
alpha Float: alpha value of the region [0.0 - 1.0].
Value is between 0.0f and 1.0f inclusive
blurRadius Float: the blur radius in pixels
Exceptions
java.lang.IllegalArgumentException if cornerRadii is null or its length is not 8 or rect is null

Public methods

copy

Added in API level 37
fun copy(): RoundedRectBlurRegion

Returns a deep copy of this blur region.

Return
RoundedRectBlurRegion This value cannot be null.

getBounds

Added in API level 37
fun getBounds(): RectF

Returns the bounds of the blur region.

Return
RectF RectF containing the bounds.
This value cannot be null.

getCornerRadii

Added in API level 37
fun getCornerRadii(): FloatArray

Returns the corner radii for the blur region.

Return
FloatArray array of 8 floats representing the corner radii.
This value cannot be null.

setBounds

Added in API level 37
fun setBounds(rect: RectF): Unit

Sets the bounds of the blur region.

The default value is an empty rectangle.

Parameters
rect RectF: the bounds of the blur region.
This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if rect is null

setCornerRadii

Added in API level 37
fun setCornerRadii(cornerRadius: Float): Unit

Sets the corner radius for all corners of the blur region.

Parameters
cornerRadius Float: radius in pixels.

setCornerRadii

Added in API level 37
fun setCornerRadii(cornerRadii: FloatArray): Unit

Sets the corner radii for the blur region.

The cornerRadii values are ordered [topLeftX, topLeftY, topRightX, topRightY, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY].

The default value is all zeros.

Parameters
cornerRadii FloatArray: array of 8 floats representing the corner radii.
This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if cornerRadii is null or its length is not 8