use of com.facebook.drawee.interfaces.DraweeController in project remusic by aa112901.
the class RoundView method setAlbum.
public void setAlbum(String albumPath) {
if (albumPath == null) {
albumView.setImageURI(Uri.parse("res:/" + R.drawable.placeholder_disk_play_song));
} else {
try {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(albumPath)).build();
DraweeController controller = Fresco.newDraweeControllerBuilder().setOldController(albumView.getController()).setImageRequest(request).setControllerListener(controllerListener).build();
albumView.setController(controller);
} catch (Exception e) {
e.printStackTrace();
}
}
Log.e("roundview", "setalbum = " + albumPath);
}
use of com.facebook.drawee.interfaces.DraweeController in project BigImageViewer by Piasy.
the class FrescoImageLoader method showThumbnail.
@Override
public View showThumbnail(BigImageView parent, Uri thumbnail, int scaleType) {
SimpleDraweeView thumbnailView = (SimpleDraweeView) LayoutInflater.from(parent.getContext()).inflate(R.layout.ui_fresco_thumbnail, parent, false);
DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(thumbnail).build();
switch(scaleType) {
case BigImageView.INIT_SCALE_TYPE_CENTER_CROP:
thumbnailView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP);
break;
case BigImageView.INIT_SCALE_TYPE_CENTER_INSIDE:
thumbnailView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.CENTER_INSIDE);
default:
break;
}
thumbnailView.setController(controller);
return thumbnailView;
}
use of com.facebook.drawee.interfaces.DraweeController in project Rocket.Chat.Android by RocketChat.
the class FrescoHelper method loadImage.
public static void loadImage(String imageUrl, SimpleDraweeView draweeView) {
final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(Uri.parse(imageUrl)).setAutoPlayAnimations(true).setTapToRetryEnabled(true).build();
draweeView.setController(controller);
}
use of com.facebook.drawee.interfaces.DraweeController in project fresco by facebook.
the class VolleyDraweeControllerBuilder method obtainController.
@Override
protected VolleyDraweeController obtainController() {
DraweeController oldController = getOldController();
VolleyDraweeController controller;
if (oldController instanceof VolleyDraweeController) {
controller = (VolleyDraweeController) oldController;
controller.initialize(obtainDataSourceSupplier(), generateUniqueControllerId(), getCallerContext());
} else {
controller = mVolleyDraweeControllerFactory.newController(obtainDataSourceSupplier(), generateUniqueControllerId(), getCallerContext());
}
return controller;
}
use of com.facebook.drawee.interfaces.DraweeController in project fresco by facebook.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// GIF
final ViewGroup gifControls = (ViewGroup) findViewById(R.id.gif_controls);
updateAnimationControls(gifControls, null);
mAnimatedGifView = (SimpleDraweeView) findViewById(R.id.animated_gif);
Uri animatedGifUri = Uri.parse("http://s3.amazonaws.com/giphygifs/media/4aBQ9oNjgEQ2k/giphy.gif");
final TextView gifInfo = (TextView) findViewById(R.id.gif_info);
DraweeController gifController = Fresco.newDraweeControllerBuilder().setUri(animatedGifUri).setControllerListener(new BaseControllerListener<ImageInfo>() {
@Override
public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable anim) {
updateAnimationControls(gifControls, anim);
gifInfo.setText(getAnimationInformation(anim));
}
}).build();
mAnimatedGifView.setController(gifController);
// Animated WebP
final ViewGroup webpControls = (ViewGroup) findViewById(R.id.webp_controls);
updateAnimationControls(webpControls, null);
mAnimatedWebpView = (SimpleDraweeView) findViewById(R.id.animated_webp);
final TextView webpInfo = (TextView) findViewById(R.id.webp_info);
Uri animatedWebpUri = Uri.parse("http://www.gstatic.com/webp/animated/1.webp");
DraweeController webpController = Fresco.newDraweeControllerBuilder().setUri(animatedWebpUri).setControllerListener(new BaseControllerListener<ImageInfo>() {
@Override
public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable anim) {
updateAnimationControls(webpControls, anim);
webpInfo.setText(getAnimationInformation(anim));
}
}).build();
mAnimatedWebpView.setController(webpController);
}
Aggregations