BeautifulPhotosPresenterImpl.java 文件源码

java
阅读 46 收藏 0 点赞 0 评论 0

项目:Beautiful-Photos 作者:
/**
 * Launch intent to share current photo
 */
@Override
public void share(final Context ctx) {
    final PhotoModel photo = photos.get(itemIndex);

    // Picasso already has cached this image, so extract cached bitmap from its cache
    Picasso.with(ctx).load(photo.getLargeUrl()).into(new Target() {
        @Override
        public void onBitmapFailed(Drawable errorDrawable) {
        }

        @Override
        public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
            // Get bitmap uri from filesystem and create intent with it.
            shareBitmap(ctx, bitmap, photo.getTitle());
        }

        @Override
        public void onPrepareLoad(Drawable placeHolderDrawable) {
             /* nothing to do */
        }
    });

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号