0

I have to provide a background blur effect like in the picture.enter image description here

The first layer contains text and switch.There is another layer below it.The properties of this layer color: #f8f8f8 alpha: 82.The actual color is present in the lower layer.True color in the picture is #D42E2E.These layers may look better in the picture below.enter image description here

How can I accomplish this without using an external library?

  • 2
    Possible duplicate of [How to blur background images in Android](https://stackoverflow.com/questions/31641973/how-to-blur-background-images-in-android) – Eugene Babich Apr 09 '19 at 07:04

1 Answers1

5

This just looks like a gradient as background with light red center color and white border colors.

You can use this Gradient Generator to create your gradient. Save the gradient-code for example in your drawables-folder as gradient.xml and use this as background of your view.

This could be your gradient

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="linear"
android:centerX="50%"
android:startColor="#FFFFFFFF"
android:centerColor="#FFFF8A8A"
android:endColor="#FFFFFFFF"
android:angle="90"/>
</shape>

Result:

enter image description here

Aiko West
  • 791
  • 1
  • 10
  • 30