@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);
}
java类com.squareup.picasso.RequestHandler的实例源码
LocalPhotoRequestHandler.java 文件源码
项目:Phoenix-for-VK
阅读 25
收藏 0
点赞 0
评论 0
ThumbnailRequestHandler.java 文件源码
项目:aos-Video
阅读 23
收藏 0
点赞 0
评论 0
@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);
}