Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, how to blur/glass/frost current activity

Basically

In an activity, I have a ListView. When I select an item, an transparent activity opens as a small box. When this box appears, you can still view the previous activities screen,

What I am trying to figure out is how to blur the previous screen like the image linked here (Ignore the UI, just look at the blurred grass area).

How is this possible?

Thank you for any advice.

like image 655
rennoDeniro Avatar asked Nov 15 '12 20:11

rennoDeniro


People also ask

Is blur available for Android?

Blur is available for both Android and iOS mobile devices and is compatible with both Mac and PC systems.

What is frosted glass effect in mobile app?

The Frosted Glass effect is a somewhat normal impact utilized in iOS and Android applications. The principal thought of adding frosted glass effect in the use of showing the view which needs to focus on a clean environment while obscuring the other content to make that less engaged.

Which is the best blur effect library for Android?

All the Android top blur effects libraries. Blurry is an easy blur library for Android. Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Blurkit is extraordinarily easy to use utility to get live blurring just like on iOS.

What is frosted glass effect in flutter?

It is fundamentally a blurred-out overlay with decreased opacity, to recognize or lessen a specific view. This component truly looks great however it influences the application’s performance. In this blog, we will explore the Frosted Glass Effect In Flutter.

What is blur effect on application background image programmatically?

Blurry effect image is common in most of android application because using the blur image effect android developer can set normal image as awesome background. So in this tutorial we would going to make App.ly Blur Effect on Application Background Image Programmatically.


1 Answers

For API < 14, you could use the flag WindowManager.LayoutParams.FLAG_BLUR_BEHIND, but it's been deprecated and built-in blurring is no longer supported on higher APIs

However, you could do this with a regular view or overlay. What you want to do is:

  • Create a Bitmap from your activity's overall layout (see here for example)
  • Blur that bitmap with whatever method you want(a few examples here)
  • Add(or unhide) a View in your layout that covers everything. Set bkg to blurred Bitmap
  • Open your dialog/transparent activity
  • When it closes, either remove the View, or setVisibility(GONE) if you'll be using it again.
like image 89
Geobits Avatar answered Nov 11 '22 19:11

Geobits