本文整理汇总了Java中com.squareup.picasso.RequestHandler类的典型用法代码示例。如果您正苦于以下问题:Java RequestHandler类的具体用法?Java RequestHandler怎么用?Java RequestHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RequestHandler类属于com.squareup.picasso包,在下文中一共展示了RequestHandler类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import com.squareup.picasso.RequestHandler; //导入依赖的package包/类
@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);
}
示例2: load
import com.squareup.picasso.RequestHandler; //导入依赖的package包/类
@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);
}