public void loadImage(Object data, ImageView imageView, ProgressBar progressBar, TextView textView) { if (data == null) { imageView.setImageBitmap(mLoadingBitmap); return; } Bitmap bitmap = null; if (mImageCache != null) { bitmap = mImageCache.getBitmapFromMemCache(String.valueOf(data)); } if (bitmap != null) { // Bitmap found in memory cache imageView.setImageBitmap(bitmap); if (progressBar != null) { progressBar.setVisibility(View.GONE); } } else if (cancelPotentialWork(data, imageView)) { final BitmapWorkerTask task = new BitmapWorkerTask(imageView, progressBar, textView); final AsyncDrawable asyncDrawable = new AsyncDrawable(mResources, mLoadingBitmap, task); imageView.setImageDrawable(asyncDrawable); try { task.execute(data); } catch (Exception ex) { Log.e(TAG, "Exception while processing images: " + ex.getMessage()); } } }
if (imageCache.getBitmapFromMemCache(message.getKeyString()) == null) { imageCache.addBitmapToCache(message.getKeyString(), data.getProfilePic()); myViewHolder.shareContactImage.setImageBitmap(imageCache.getBitmapFromMemCache(message.getKeyString()));
if (imageCache.getBitmapFromMemCache(message.getKeyString()) != null) { galleryImageView.setImageBitmap(imageCache.getBitmapFromMemCache(message.getKeyString())); } else { imageCache.addBitmapToCache(message.getKeyString(), fileClientService.createAndSaveVideoThumbnail(message.getFilePaths().get(0)));
if (imageCache.getBitmapFromMemCache(message.getKeyString()) != null) { galleryImageView.setImageBitmap(imageCache.getBitmapFromMemCache(message.getKeyString())); } else { imageCache.addBitmapToCache(message.getKeyString(), fileClientService.createAndSaveVideoThumbnail(message.getFilePaths().get(0)));
myHolder.imageViewRLayout.setVisibility(View.VISIBLE); if (msg.getFilePaths() != null && msg.getFilePaths().size() > 0) { if (imageCache.getBitmapFromMemCache(msg.getKeyString()) != null) { myHolder.imageViewPhoto.setImageBitmap(imageCache.getBitmapFromMemCache(msg.getKeyString())); } else { imageCache.addBitmapToCache(message.getKeyString(), fileClientService.createAndSaveVideoThumbnail(msg.getFilePaths().get(0))); myHolder.attachmentDownloadProgressLayout.setVisibility(View.GONE); myHolder.attachedFile.setVisibility(View.GONE); if (imageCache.getBitmapFromMemCache(message.getKeyString()) != null) { myHolder.preview.setImageBitmap(imageCache.getBitmapFromMemCache(message.getKeyString())); } else { imageCache.addBitmapToCache(message.getKeyString(), fileClientService.createAndSaveVideoThumbnail(filePath));