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(rect: RectF, cornerRadii: FloatArray, alpha: Float, blurRadius: Float)Constructs a new |
|
| Public methods | |
|---|---|
| RoundedRectBlurRegion |
copy()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
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
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
fun copy(): RoundedRectBlurRegion
Returns a deep copy of this blur region.
| Return | |
|---|---|
RoundedRectBlurRegion |
This value cannot be null. |
getBounds
fun getBounds(): RectF
Returns the bounds of the blur region.
| Return | |
|---|---|
RectF |
RectF containing the bounds. This value cannot be null. |
getCornerRadii
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
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
fun setCornerRadii(cornerRadius: Float): Unit
Sets the corner radius for all corners of the blur region.
| Parameters | |
|---|---|
cornerRadius |
Float: radius in pixels. |
setCornerRadii
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 |