Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7 blur in Android

Tags:

android

I'm working on a new Android app designed in really flat style. I want to have a DialogAlert that shows up on a blurred background. Effect similiar to the control center on this photo (don't write about NDA, this photo is available on Apple's website):

iOS7

Is it possible? If so, the most important question: how?

M.

like image 827
Maciej Wilczyński Avatar asked Aug 26 '13 22:08

Maciej Wilczyński


1 Answers

Yes this is possible, You have to use something called renderscript. so what you need is bitmap from the view this can be done using the following code.

View v // target view to be blurred
v.setDrawingCacheEnabled(true);
Bitmap screenshot = Bitmap.createBitmap(v.getDrawingCache());

Now use the renderscript to get the blurred bitmap shown here http://blog.neteril.org/blog/2013/08/12/blurring-images-on-android/ and draw it to your view.

like image 139
Rohit Avatar answered Oct 02 '22 16:10

Rohit