use of com.facebook.drawee.interfaces.DraweeController in project teaTime by ancfdy.
the class FrescoUtils method changeImgSize.
/**
* 自定义图片尺寸
* @param draweeView 显示的控件
* @param uriString 地址
* @param width 50
* @param height 50
*/
public static void changeImgSize(SimpleDraweeView draweeView, String uriString, int width, int height) {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(uriString)).setResizeOptions(new ResizeOptions(width, height)).build();
DraweeController controller = Fresco.newDraweeControllerBuilder().setImageRequest(request).setAutoPlayAnimations(// other setters
true).build();
draweeView.setController(controller);
}
use of com.facebook.drawee.interfaces.DraweeController in project teaTime by ancfdy.
the class FrescoUtils method localImg.
/**
* 缩略图预览(仅支持本地图片,并且是JPEG图片格式)
* @param draweeView
* @param uri
*/
public static void localImg(SimpleDraweeView draweeView, Uri uri) {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri).setLocalThumbnailPreviewsEnabled(true).build();
DraweeController controller = Fresco.newDraweeControllerBuilder().setImageRequest(request).setOldController(draweeView.getController()).build();
draweeView.setController(controller);
}
use of com.facebook.drawee.interfaces.DraweeController in project teaTime by ancfdy.
the class FrescoUtils method loadImage.
/**
* 请求图片
* @param uri - 唯一的必选的成员. 参考 支持的URIs
* @param width
* @param height
* autoRotateEnabled - 是否支持自动旋转.
* progressiveEnabled - 是否支持渐进式加载.
* postprocessor - 后处理器(postprocess).
* resizeOptions - 图片缩放选项,用前请先阅读缩放和旋转
*/
public static void loadImage(SimpleDraweeView draweeView, String uri, int width, int height) {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(uri)).setAutoRotateEnabled(// 是否支持自动旋转.
true).setImageDecodeOptions(// 图片解码库
getImageDecodeOptions()).setLowestPermittedRequestLevel(// 请求经过缓存级别 BITMAP_MEMORY_CACHE,ENCODED_MEMORY_CACHE,DISK_CACHE,FULL_FETCH
RequestLevel.FULL_FETCH).setProgressiveRenderingEnabled(// 渐进加载,主要用于渐进式的JPEG图,影响图片显示速度(普通)
false).setResizeOptions(new ResizeOptions(width, height)).build();
DraweeController controller = Fresco.newDraweeControllerBuilder().setImageRequest(request).setOldController(draweeView.getController()).build();
draweeView.setController(controller);
}
use of com.facebook.drawee.interfaces.DraweeController in project BigImageViewer by Piasy.
the class FrescoImageViewFactory method loadAnimatedContent.
@Override
public final void loadAnimatedContent(final View view, final int imageType, final File imageFile) {
if (view instanceof SimpleDraweeView) {
final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(Uri.parse("file://" + imageFile.getAbsolutePath())).setAutoPlayAnimations(true).build();
((SimpleDraweeView) view).setController(controller);
}
}
use of com.facebook.drawee.interfaces.DraweeController in project BigImageViewer by Piasy.
the class FrescoImageViewFactory method loadThumbnailContent.
@Override
public void loadThumbnailContent(final View view, final Uri thumbnail) {
if (view instanceof SimpleDraweeView) {
final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(thumbnail).build();
((SimpleDraweeView) view).setController(controller);
}
}
Aggregations