7

I'm trying to blur a view or layout like the example i have below. So far I have only seen examples of bluring images and im confused on how to implement a blur on a layout. I hope you guys can help!

enter image description here

Cheers!

TheQ
  • 1,869
  • 7
  • 36
  • 61
  • Hey check this link http://stackoverflow.com/questions/6795483/create-blurry-transparent-background-effect and http://stackoverflow.com/questions/31641973/how-to-blur-background-images-in-android – Sagar Gangawane Nov 28 '16 at 04:39

1 Answers1

9

Try this Library its nice and simple to use.

Setup

Dependencies

dependencies {
compile 'jp.wasabeef:blurry:2.0.3'
}

Functions

Overlay

Parent must be ViewGroup

Blurry.with(context).radius(25).sampling(2).onto((ViewGroup) rootView);

Into

Blurry.with(context).capture(view).into(imageView);

Blur Options

  • Radius
  • Down Sampling
  • Color Filter
  • Asynchronous Support
  • Animation (Overlay Only)

Blurry.with(context)
.radius(10)
.sampling(8)
.color(Color.argb(66, 255, 255, 0))
.async()
.animate(500)
.onto(rootView);

OutPut:

enter image description here

Community
  • 1
  • 1
Maveňツ
  • 9,147
  • 14
  • 53
  • 94
  • Am I the only one who can't achieve the effect from the question using this library? I refer to the bottom transparent blurry view... – NixSam Mar 15 '22 at 16:12
  • @NixSam for that you can create translucent layout at the bottom – Maveňツ Mar 17 '22 at 10:49
  • @Maven Yes, it can be translucent, but it won't be blurry. The most similar thing natively is this: https://source.android.com/devices/tech/display/window-blurs – NixSam Mar 21 '22 at 11:44