Reputation:
I have to provide a background blur effect like in the picture.
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.
How can I accomplish this without using an external library?
Upvotes: 0
Views: 2283
Reputation: 791
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:
Upvotes: 5