Skip to content

Glide

WARNING

Before using Transform, make sure you have integrated the Glide library.

gradle
dependencies {
    // QmBlurView Transform dependency
    implementation 'com.qmdeve.blurview:transform:1.1.2'

    // Glide dependency
    implementation 'com.github.bumptech.glide:glide:5.0.5'
}

Import Class

java
// Glide main class
import com.bumptech.glide.Glide;

// QmBlurView blur transformation class
import com.qmdeve.blurview.transform.glide.BlurTransformation;

Usage Example

java
Glide.with(this)
    .load(R.drawable.image)
    .apply(new RequestOptions().transform(
           new CenterCrop(),

         /**
          * Use blur transformation
          * new BlurTransformation() // Default blur radius 25f, no rounded corners
          * new BlurTransformation(float blurRadius) // Custom blur radius, no rounded corners
          * new BlurTransformation(float blurRadius, float roundedCorners) // Custom blur radius and rounded corners
          */
           new BlurTransformation(24f, 50)
       ))
    .into(imageView);

Constructors

ConstructorDescription
BlurTransformation()Creates a blur transformation with the default blur radius of 25f and no rounded corners
BlurTransformation(float blurRadius)Creates a blur transformation with a custom blur radius and no rounded corners
BlurTransformation(float blurRadius, float roundedCorners)Creates a blur transformation with a custom blur radius and custom rounded corners