Java 类com.squareup.picasso.RequestHandler 实例源码

项目:Phoenix-for-VK    文件:LocalPhotoRequestHandler.java   
@Override
public RequestHandler.Result load(Request data, int arg1) throws IOException {
    long imageId = Long.parseLong(data.uri.getLastPathSegment());

    Bitmap bm = Stores.getInstance()
            .localPhotos()
            .getImageThumbnail(imageId);

    return new RequestHandler.Result(bm, Picasso.LoadedFrom.DISK);
}
项目:aos-Video    文件:ThumbnailRequestHandler.java   
@Override
public Result load(Request request, int networkPolicy) throws IOException {
    final long videoId = Long.parseLong(request.uri.getHost());
    if (videoId<0) {
        return null;
    }
    Bitmap thumbnail = VideoStore.Video.Thumbnails.getThumbnail(mContext.getContentResolver(), videoId, VideoStore.Video.Thumbnails.MINI_KIND, null, !"1".equals(request.uri.getQueryParameter("nothumbcreation")));
    if (thumbnail==null) {
        return null;
    }
    return new RequestHandler.Result(thumbnail, Picasso.LoadedFrom.DISK);
}