by Soiad Mahedi
BlurBackgroundLayout is a custom Android view that allows you to set a background image and optionally blur it.
It’s perfect for creating beautiful UI layouts with blurred background effects, while keeping your content sharp and readable.
- Set a background image with ease.
- Enable/disable blur dynamically.
- Adjustable blur radius (default:
25f). - Uses
RenderEffecton Android 12+ for performance. - Uses
RenderScriptfor older devices. - Supports any
LinearLayoutcontent inside.
Copy the file BlurBackgroundLayout.java into your project’s package.
<com.soiadmahedi.blurbackgroundlayout.BlurBackgroundLayout
android:id="@+id/linear_blurbackgroundlayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Your content here -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello Blur!"
android:textColor="@android:color/white"
android:textSize="22sp" />
</LinearLayout>
</com.soiadmahedi.blurbackgroundlayout.BlurBackgroundLayout>BlurBackgroundLayout blurLayout = findViewById(R.id.linear_blurbackgroundlayout);
// Set background image
blurLayout.setBackgroundImage(R.drawable.image_soiadmahedi);
// Enable blur
blurLayout.enableBlur(true);
// Disable blur
blurLayout.enableBlur(false);Android Version: API 16+ (Blur effect works best on API 17+)
- Java / Kotlin Compatible
Soiad Mahedi
GitHub Profile


