MCPcopy Index your code
hub / github.com/Dimezis/BlurView

github.com/Dimezis/BlurView @version-3.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release version-3.2.0 ↗ · + Follow
150 symbols 312 edges 20 files 28 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Stand With Ukraine

BlurView

Dynamic iOS-like blur for Android Views. Includes a library and a small example project.

BlurView can be used as a regular FrameLayout. It blurs its underlying content and draws it as a background for its children. The children of the BlurView are not blurred. BlurView updates its blurred content when changes in the view hierarchy are detected. It honors its position and size changes, including view animation and property animation.

[!IMPORTANT] Version 3.0 info, key changes, migration steps, and what you need to know is here.

Also, the code path on API 31+ is now completely different from API < 31, so keep in mind to test both.

How to use

Now you have to wrap the content you want to blur into a BlurTarget, and pass it into the setupWith() method of the BlurView.

The BlurTarget may not contain a BlurView that targets the same BlurTarget.

The BlurTarget may contain other BlurTargets and BlurViews though.


    <eightbitlab.com.blurview.BlurTarget
        android:id="@+id/target"
        android:layout_width="match_parent"
        android:layout_height="match_parent">



    </eightbitlab.com.blurview.BlurTarget>

    <eightbitlab.com.blurview.BlurView
      android:id="@+id/blurView"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:blurOverlayColor="@color/colorOverlay">



    </eightbitlab.com.blurview.BlurView>
    float radius = 20f;

    View decorView = getWindow().getDecorView();
    // A view hierarchy you want blur. The BlurTarget can't include the BlurView that targets it.
    BlurTarget target = findViewById(R.id.target);

    // Optional:
    // Set the drawable to draw in the beginning of each blurred frame.
    // Can be used in case your layout has a lot of transparent space and your content
    // gets a low alpha value after blur is applied.
    Drawable windowBackground = decorView.getBackground();

    // Optionally pass a custom BlurAlgorithm and scale factor as additional parameters.
    // You might want to set a smaller scale factor on API 31+ to have a more precise blur with less flickering.
    blurView.setupWith(target) 
           .setFrameClearDrawable(windowBackground) // Optional. Useful when your root has a lot of transparent background, which results in semi-transparent blurred content. This will make the background opaque
           .setBlurRadius(radius)

SurfaceView, TextureView, VideoView, MapFragment, GLSurfaceView, etc

TextureView can be blurred only on API 31+. Everything else (which is SurfaceView-based) can't be blurred, unfortunately.

Gradle

Use Jitpack https://jitpack.io/#Dimezis/BlurView and release tags as the source of stable artifacts.

implementation 'com.github.Dimezis:BlurView:version-3.2.0'

Rounded corners

It's possible to set rounded corners without any custom API, the algorithm is the same as with other regular View:

Create a rounded drawable, and set it as a background.

Then set up the clipping, so the BlurView doesn't draw outside the corners

blurView.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
blurView.setClipToOutline(true);

Related thread - https://github.com/Dimezis/BlurView/issues/37

Why blurring on the main thread?

Because blurring on other threads would introduce 1-2 frames of latency. On API 31+ the blur is done on the system Render Thread.

Compared to other blurring libs

  • BlurView and Haze for Compose are the only libraries that leverage hardware acceleration for View snapshotting and have near zero overhead of snapshotting.
  • Supports TextureView blur on API 31+.
  • The BlurView never invalidates itself or other Views in the hierarchy and updates only when needed.
  • It supports multiple BlurViews on the screen without triggering a draw loop.
  • On API < 31 it uses optimized RenderScript Allocations on devices that require certain Allocation sizes, which greatly increases blur performance.
  • Supports blurring of Dialogs (and Dialog's background)

Other libs: - 🛑 BlurKit - constantly invalidates itself - 🛑 RealtimeBlurView - constantly invalidates itself

License

Copyright 2025 Dmytro Saviuk

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

BlurController (Interface)
(no doc) [6 implementers]
library/src/main/java/eightbitlab/com/blurview/BlurController.java
BlurViewFacade (Interface)
(no doc) [3 implementers]
library/src/main/java/eightbitlab/com/blurview/BlurViewFacade.java
BlurAlgorithm (Interface)
(no doc) [2 implementers]
library/src/main/java/eightbitlab/com/blurview/BlurAlgorithm.java

Core symbols most depended-on inside this repo

destroy
called by 8
library/src/main/java/eightbitlab/com/blurview/BlurAlgorithm.java
draw
called by 7
library/src/main/java/eightbitlab/com/blurview/BlurController.java
scale
called by 7
library/src/main/java/eightbitlab/com/blurview/SizeScaler.java
setBlurRadius
called by 5
library/src/main/java/eightbitlab/com/blurview/BlurViewFacade.java
init
called by 3
library/src/main/java/eightbitlab/com/blurview/BlurView.java
usingRenderNode
called by 3
library/src/main/java/eightbitlab/com/blurview/BlurView.java
setBlurAutoUpdate
called by 3
library/src/main/java/eightbitlab/com/blurview/PreDrawBlurController.java
applyBlur
called by 3
library/src/main/java/eightbitlab/com/blurview/RenderNodeBlurController.java

Shape

Method 126
Class 20
Interface 3
Enum 1

Languages

Java100%

Modules by API surface

library/src/main/java/eightbitlab/com/blurview/RenderNodeBlurController.java22 symbols
library/src/main/java/eightbitlab/com/blurview/BlurView.java17 symbols
app/src/main/java/com/eightbitlab/blurview_sample/MainActivity.java16 symbols
library/src/main/java/eightbitlab/com/blurview/PreDrawBlurController.java15 symbols
library/src/main/java/eightbitlab/com/blurview/SizeScaler.java11 symbols
library/src/main/java/eightbitlab/com/blurview/NoOpController.java9 symbols
library/src/main/java/eightbitlab/com/blurview/RenderScriptBlur.java8 symbols
app/src/main/java/com/eightbitlab/blurview_sample/ExampleListAdapter.java7 symbols
library/src/main/java/eightbitlab/com/blurview/BlurViewFacade.java6 symbols
library/src/main/java/eightbitlab/com/blurview/BlurAlgorithm.java6 symbols
library/src/test/java/eightbitlab/com/blurview/SizeScalerTest.java5 symbols
library/src/main/java/eightbitlab/com/blurview/Noise.java4 symbols

For agents

$ claude mcp add BlurView \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact