Thursday, 29 May 2014

Avoid blinking imageViews in android - example nostra confuguration

Here is short code describing configuration for imageLoader to avoid blinking images when scrolling.

 imageLoader = ImageLoader.getInstance();  
 imageLoader.init(configBuilder);  
   
 imageLoaderOptions = new DisplayImageOptions.Builder()  
           .cacheInMemory(true)   
           .cacheOnDisc(true)   
           .imageScaleType(ImageScaleType.EXACTLY)   
           .bitmapConfig(Bitmap.Config.ARGB_8888)   
           .handler(new Handler())   
           .build();  
             
 imageLoader.displayImage("https://i.imgur.com/1od0gIFl.jpg", myImageView, imageLoaderOptions);