com.squareup.picasso.Picasso.LoadedFrom Java Examples

The following examples show how to use com.squareup.picasso.Picasso.LoadedFrom. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: AnimeTaste   Author: daimajia   File: PlayActivity.java    License: MIT License 6 votes vote down vote up
@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();
    }
}
 
Example #2
Source Project: Virtualview-Android   Author: alibaba   File: LocalPreviewActivity.java    License: MIT License 5 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
    mImageBase.setBitmap(bitmap, true);
    if (mListener != null) {
        mListener.onImageLoadSuccess(bitmap);
    }
    Log.d("LocalPreviewActivity", "onBitmapLoaded " + from);
}
 
Example #3
Source Project: Virtualview-Android   Author: alibaba   File: VirtualViewApplication.java    License: MIT License 5 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
    mImageBase.setBitmap(bitmap, true);
    if (mListener != null) {
        mListener.onImageLoadSuccess(bitmap);
    }
    Log.d("VirtualViewApplication", "onBitmapLoaded " + from);
}
 
Example #4
Source Project: Tangram-Android   Author: alibaba   File: RxTangramActivity.java    License: MIT License 5 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
    mImageBase.setBitmap(bitmap, true);
    if (mListener != null) {
        mListener.onImageLoadSuccess(bitmap);
    }
    Log.d("TangramActivity", "onBitmapLoaded " + from);
}
 
Example #5
Source Project: Tangram-Android   Author: alibaba   File: TangramActivity.java    License: MIT License 5 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
    mImageBase.setBitmap(bitmap, true);
    if (mListener != null) {
        mListener.onImageLoadSuccess(bitmap);
    }
    Log.d("TangramActivity", "onBitmapLoaded " + from);
}
 
Example #6
Source Project: Tangram-Android   Author: alibaba   File: BannerTestActivity.java    License: MIT License 5 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
    mImageBase.setBitmap(bitmap, true);
    if (mListener != null) {
        mListener.onImageLoadSuccess(bitmap);
    }
    Log.d("TangramActivity", "onBitmapLoaded " + from);
}
 
Example #7
Source Project: Klyph   Author: jonathangerbaud   File: NotificationService.java    License: MIT License 5 votes vote down vote up
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);
		}
	});
}
 
Example #8
Source Project: Mizuu   Author: MizzleDK   File: CoverItem.java    License: Apache License 2.0 5 votes vote down vote up
@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);
    }
}
 
Example #9
Source Project: Contacts   Author: jonathangerbaud   File: SimpleFakeImageLoaderListener.java    License: MIT License 4 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from)
{
	
}
 
Example #10
Source Project: Klyph   Author: jonathangerbaud   File: SimpleFakeImageLoaderListener.java    License: MIT License 4 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from)
{
	
}
 
Example #11
Source Project: barterli_android   Author: barterli   File: RoundedCornerImageView.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
    mRoundedCornerImageView.setImageBitmap(bitmap);
}
 
Example #12
Source Project: KlyphMessenger   Author: jonathangerbaud   File: SimpleFakeImageLoaderListener.java    License: MIT License 4 votes vote down vote up
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from)
{
	
}