Skip to content

ProgressiveBlurView

Use Component

xml
<com.qmdeve.blurview.widget.ProgressiveBlurView
    android:layout_width="match_parent"
    android:layout_height="150dp"
    app:progressiveOverlayColor="#AAFFFFFF"
    app:progressiveDirection="topToBottom"
    app:progressiveBlurRadius="25dp" />
java
ProgressiveBlurView progressive = new ProgressiveBlurView(context);
progressive.setGradientDirection(ProgressiveBlurView.DIRECTION_TOP_TO_BOTTOM);
progressive.setBlurRadius(25f);
progressive.setOverlayColor(0xAAFFFFFF);
kotlin
val progressive = ProgressiveBlurView(context)
progressive.setGradientDirection(ProgressiveBlurView.DIRECTION_TOP_TO_BOTTOM)
progressive.setBlurRadius(25f)
progressive.setOverlayColor(0xAAFFFFFF.toInt())

Attribute Description

Attribute NameTypeDefault ValueDescription
app:progressiveOverlayColorcolor#AAFFFFFFOverlay gradient color.
app:progressiveDirectionenumtopToBottomGradient direction. Values: topToBottom, bottomToTop, leftToRight, rightToLeft.
app:progressiveBlurRadiusdimension25dpBase blur radius used by the progressive renderer.
app:progressiveLayersinteger-Declared in attrs, currently not consumed by the implementation.

API Reference

MethodDescription
setGradientDirection(int)Set direction with constants: DIRECTION_TOP_TO_BOTTOM, DIRECTION_BOTTOM_TO_TOP, DIRECTION_LEFT_TO_RIGHT, DIRECTION_RIGHT_TO_LEFT.
setOverlayColor(int)Set progressive overlay color.
setOverlayColorRes(@ColorRes int)Set progressive overlay color from a color resource.
setBlurRadius(float)Set progressive blur radius.
setCornerRadius(float)Overridden to keep corner radius at 0 for this view.