Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to blur a view or layout in android?

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!

like image 447
TheQ Avatar asked Nov 28 '16 04:11

TheQ


1 Answers

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

like image 195
Maveňツ Avatar answered Sep 28 '22 10:09

Maveňツ