-3

I am trying to add a blur effect on the widget icon's background, so that the widget icon can have a blurry background. Googled a lot, but can't come up with definite answer. Can anyone please suggest me ways how to do it with a referral link? Thanks for any kind of help.

Here is the XML code I am using for my widget.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" 
    android:layout_gravity="center">

    <ImageView
        android:id="@+id/toggle"
        android:contentDescription="@string/content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/offw" />


</LinearLayout>

And here is the code of app_widget provider

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" 
    android:widgetCategory="keyguard|home_screen"
    android:minWidth="36dip"
    android:minHeight="36dip"
    android:updatePeriodMillis="86400000"
    android:initialLayout="@layout/main"

/>
user3673503
  • 385
  • 2
  • 6
  • 14
  • show your widget xml code – raj Sep 29 '14 at 07:10
  • 1
    You **did no search at all**: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=android%20blur%20background – Phantômaxx Sep 29 '14 at 07:17
  • This question appears to be off-topic because it shows no effort in searching for an answer outside SO – Phantômaxx Sep 29 '14 at 07:17
  • I have updated the widget xml code in the question @raj – user3673503 Sep 29 '14 at 07:18
  • @FrankN.Stein I have googled as much as I could do. Can blur an imageview with the help of this http://stackoverflow.com/questions/6795483/create-blurry-transparent-background-effect link. But it doesn't help me to blur my widget. – user3673503 Sep 29 '14 at 07:20

1 Answers1

0

enter image description herego to your widgets xml layout

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical" 
  android:background="@drawable/blureffect"
  android:layout_gravity="center">

in res/drawable/ directory create a xml file name it blureffect.xml and paste below code in this file.

 <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
    android:startColor="#9f4b91"
    android:centerColor="#563fdf"
    android:endColor="#9f4b91"
    android:type="linear"
    android:angle="0"/>
 </shape>
raj
  • 2,088
  • 14
  • 23