@Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom arg1) { mDetailImageView.setImageBitmap(bitmap); mDetailPicture = bitmap; mLoadingGif.setVisibility(View.INVISIBLE); mPrePlayButton.setVisibility(View.VISIBLE); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); mDetailPicture.compress(CompressFormat.JPEG, 100, bytes); File file = new File(mContext.getCacheDir(), "toshare.jpg"); try { if (file.exists()) { file.delete(); } file.createNewFile(); FileOutputStream fo = new FileOutputStream(file); fo.write(bytes.toByteArray()); fo.close(); } catch (IOException e) { e.printStackTrace(); } }
@Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) { mImageBase.setBitmap(bitmap, true); if (mListener != null) { mListener.onImageLoadSuccess(bitmap); } Log.d("VirtualViewApplication", "onBitmapLoaded " + from); }
@Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) { mImageBase.setBitmap(bitmap, true); if (mListener != null) { mListener.onImageLoadSuccess(bitmap); } Log.d("TangramActivity", "onBitmapLoaded " + from); }
private void createTarget() { target = new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) { materialProgressBar.setVisibility(View.INVISIBLE); imageView.setScaleType(ScaleType.CENTER_CROP); imageView.setColor(Color.TRANSPARENT); imageView.setImageBitmap(bitmap); imageView.invalidate(); if (callBack != null) { callBack.onBitmapLoaded(); } } @Override public void onBitmapFailed(Drawable errorDrawable) { materialProgressBar.setVisibility(View.INVISIBLE); imageView.setScaleType(ScaleType.CENTER_INSIDE); imageView.setImageDrawable(errorDrawable); if (callBack != null) { callBack.onBitmapFailed(); } } @Override public void onPrepareLoad(Drawable placeHolderDrawable) { if (callBack != null) { callBack.onPrepareLoad(); } } }; }
private void sendNotification(final Notification notification, final boolean sendDetails) { final Builder builder = KlyphNotification.getBuilder(service.get(), true); builder.setContentTitle(notification.getSender_name()); builder.setContentText(notification.getTitle_text()); builder.setTicker(String.format("%1$s\n%2$s", notification.getSender_name(), notification.getTitle_text())); ImageLoader.loadImage(notification.getSender_pic(), new SimpleFakeImageLoaderListener() { @Override public void onBitmapFailed(Drawable drawable) { if (sendDetails) KlyphNotification.sendNotification(service.get(), builder, notification); else KlyphNotification.sendNotification(service.get(), builder); } @Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom arg1) { builder.setLargeIcon(bitmap); if (sendDetails) KlyphNotification.sendNotification(service.get(), builder, notification); else KlyphNotification.sendNotification(service.get(), builder); } }); }
@Override public void onBitmapLoaded(Bitmap arg0, LoadedFrom arg1) { cover.setImageBitmap(arg0); try { ObjectAnimator.ofFloat(cover, "alpha", 0f, 1f).setDuration(animationDuration).start(); } catch (Exception e) { // Some devices crash at runtime when using the ObjectAnimator cover.setAlpha(1f); } }
@Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) { }
@Override public void onBitmapLoaded(Bitmap arg0, LoadedFrom arg1) { cover.setBackgroundColor(Color.TRANSPARENT); cover.setImageBitmap(arg0); ObjectAnimator.ofFloat(cover, "alpha", 0f, 1f).setDuration(ANIMATION_DURATION).start(); }
@Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) { mRoundedCornerImageView.setImageBitmap(bitmap); }
@Override public void onSuccess(Bitmap arg0, LoadedFrom arg1) { imageView.setImageBitmap(arg0); }