Blur iOS 7 on Android

I am working on a new Android application designed in a really flat style. I want to have a DialogAlert that appears on a blurry background. The effect is similar to the control center in this photo (do not write about the NDA, this photo is available on the Apple website):

iOS7

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

M.

+6
source share
4 answers

Yes it is possible, you need to use something called renderscript. so you need a 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 renderscript to get the blurry bitmap shown here. http://blog.neteril.org/blog/2013/08/12/blurring-images-on-android/ and draw it in your view.

+6
source

Yes it is possible. Instead of creating a dialogue, creating and acting in the manifest, add android:theme="@android:style/Theme.Dialog" to your activity, as shown below:

 <activity android:name=".Activity" android:label="@string/title_activity" android:theme="@android:style/Theme.Dialog"> <intent-filter> <action android:name="example.package" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 
0
source

It can be done, but there is no quick and easy way to do it. Check out our BlurMask filter in the Android or Android developer documentation for how to blur / glass / frost the current activity for some suggested steps.

0
source

Create a blurry bitmap in Photoshop and set it as the Activity / Dialog background image.

0
source

Source: https://habr.com/ru/post/952547/


All Articles