use of com.facebook.drawee.interfaces.DraweeController in project remusic by aa112901.
the class LockActivity method updateTrack.
public void updateTrack() {
lrcRows = getLrcRows();
String url = MusicPlayer.getAlbumPath();
if (url == null) {
mBack.setImageURI(Uri.parse("res:/" + R.drawable.login_bg_night));
} else {
try {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url)).build();
DraweeController controller = Fresco.newDraweeControllerBuilder().setOldController(mBack.getController()).setImageRequest(request).setControllerListener(controllerListener).build();
mBack.setController(controller);
} catch (Exception e) {
e.printStackTrace();
}
}
}
use of com.facebook.drawee.interfaces.DraweeController in project Rocket.Chat.Android by RocketChat.
the class RocketChatAvatar method loadImage.
public void loadImage(String url, Drawable placeholder) {
final GenericDraweeHierarchy hierarchy = draweeView.getHierarchy();
hierarchy.setPlaceholderImage(placeholder);
hierarchy.setFailureImage(placeholder);
final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(Uri.parse(url)).setAutoPlayAnimations(true).build();
draweeView.setController(controller);
}
use of com.facebook.drawee.interfaces.DraweeController in project remusic by aa112901.
the class QuickControlsFragment method updateNowplayingCard.
public void updateNowplayingCard() {
mTitle.setText(MusicPlayer.getTrackName());
mArtist.setText(MusicPlayer.getArtistName());
ControllerListener controllerListener = new BaseControllerListener<ImageInfo>() {
@Override
public void onFinalImageSet(String id, @Nullable ImageInfo imageInfo, @Nullable Animatable anim) {
if (imageInfo == null) {
return;
}
QualityInfo qualityInfo = imageInfo.getQualityInfo();
FLog.d("Final image received! " + "Size %d x %d", "Quality level %d, good enough: %s, full quality: %s", imageInfo.getWidth(), imageInfo.getHeight(), qualityInfo.getQuality(), qualityInfo.isOfGoodEnoughQuality(), qualityInfo.isOfFullQuality());
}
@Override
public void onIntermediateImageSet(String id, @Nullable ImageInfo imageInfo) {
// FLog.d("Intermediate image received");
}
@Override
public void onFailure(String id, Throwable throwable) {
mAlbumArt.setImageURI(Uri.parse("res:/" + R.drawable.placeholder_disk_210));
}
};
Uri uri = null;
try {
uri = Uri.parse(MusicPlayer.getAlbumPath());
} catch (Exception e) {
e.printStackTrace();
}
if (uri != null) {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri).build();
DraweeController controller = Fresco.newDraweeControllerBuilder().setOldController(mAlbumArt.getController()).setImageRequest(request).setControllerListener(controllerListener).build();
mAlbumArt.setController(controller);
} else {
mAlbumArt.setImageURI(Uri.parse("content://" + MusicPlayer.getAlbumPath()));
}
}
use of com.facebook.drawee.interfaces.DraweeController in project fresco by facebook.
the class SimpleDraweeView method setImageRequest.
/**
* Sets the image request
*
* @param request Image Request
*/
public void setImageRequest(ImageRequest request) {
AbstractDraweeControllerBuilder controllerBuilder = mControllerBuilder;
DraweeController controller = controllerBuilder.setImageRequest(request).setOldController(getController()).build();
setController(controller);
}
use of com.facebook.drawee.interfaces.DraweeController in project fresco by facebook.
the class DraweeMocks method mockController.
/**
* Creates a mock DraweeController with some methods stubbed.
*
* @return mock DraweeController
*/
public static DraweeController mockController() {
DraweeController controller = mock(AbstractDraweeController.class);
stubGetAndSetHierarchy(controller);
stubGetAndSetContentDescription(controller);
return controller;
}
Aggregations