Blur image with universal image downloader

I am using Universal Image Loader and I want to blur images. I was thinking of creating a class that I could use in xml to create a view. Sort of:

<folder.classblur..
          android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/coverImageViewFavorites"
        android:src="@drawable/bg_empty_player"
       />     instead of <ImageView...

This is my main class (part of it)

    public class Photos 
     {

     private ImageLoader imageLoader;
  private ImageView coverView;

   @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


          imageLoader = ImageLoader.getInstance();
    coverView = (ImageView) findViewById(R.id.coverImageViewFavorites);
    Track track = traksList.get(trackPosition);


        imageLoader.displayImage(track.getArtworkUrl().replace("-large", "-crop"),coverView);

 }
}

xml file:

  <RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
    >


    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/coverImageViewFavorites"
        android:src="@drawable/bg_empty_player"
       />
    </RelativeLayout>
+4
source share

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


All Articles