use of com.facebook.drawee.generic.GenericDraweeHierarchyBuilder in project actor-platform by actorapp.
the class CallBackgroundAvatarView method init.
public void init() {
if (blurActor == null) {
blurActor = system().actorOf(Props.create(new ActorCreator() {
@Override
public BlurActor create() {
return new BlurActor();
}
}), "actor/call_blur");
}
GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
GenericDraweeHierarchy hierarchy = builder.setFadeDuration(200).build();
setHierarchy(hierarchy);
}
use of com.facebook.drawee.generic.GenericDraweeHierarchyBuilder in project actor-platform by actorapp.
the class CoverAvatarView method init.
private void init() {
if (isInEditMode()) {
return;
}
GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
builder.setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP);
builder.setOverlay(new CoverOverlayDrawable(getContext()));
if (ActorSDK.sharedActor().style.getAvatarBackgroundResourse() != 0) {
builder.setPlaceholderImage(getResources().getDrawable(ActorSDK.sharedActor().style.getAvatarBackgroundResourse()), ScalingUtils.ScaleType.CENTER_CROP);
} else {
builder.setPlaceholderImage(new ColorDrawable(ActorSDK.sharedActor().style.getAvatarBackgroundColor()));
}
builder.setFadeDuration(0);
setHierarchy(builder.build());
}
use of com.facebook.drawee.generic.GenericDraweeHierarchyBuilder in project fresco by facebook.
the class VolleyDraweeAdapter method onCreateViewHolder.
@Override
public VolleyDraweeHolder onCreateViewHolder(ViewGroup parent, int viewType) {
GenericDraweeHierarchy gdh = new GenericDraweeHierarchyBuilder(getContext().getResources()).setPlaceholderImage(Drawables.sPlaceholderDrawable).setFailureImage(Drawables.sErrorDrawable).build();
InstrumentedDraweeView view = new InstrumentedDraweeView(getContext());
view.setHierarchy(gdh);
return new VolleyDraweeHolder(getContext(), parent, view, getPerfListener());
}
use of com.facebook.drawee.generic.GenericDraweeHierarchyBuilder in project apps-android-wikipedia by wikimedia.
the class GalleryItemFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_gallery_item, container, false);
progressBar = rootView.findViewById(R.id.gallery_item_progress_bar);
videoContainer = rootView.findViewById(R.id.gallery_video_container);
videoView = rootView.findViewById(R.id.gallery_video);
videoThumbnail = rootView.findViewById(R.id.gallery_video_thumbnail);
videoPlayButton = rootView.findViewById(R.id.gallery_video_play_button);
imageView = rootView.findViewById(R.id.gallery_image);
imageView.setTapListener(new DoubleTapGestureListener(imageView) {
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
parentActivity.toggleControls();
return true;
}
});
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(getResources()).setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER).build();
imageView.setHierarchy(hierarchy);
return rootView;
}
use of com.facebook.drawee.generic.GenericDraweeHierarchyBuilder in project apps-android-wikipedia by wikimedia.
the class ZoomableDraweeView method inflateHierarchy.
protected void inflateHierarchy(Context context, @Nullable AttributeSet attrs) {
Resources resources = context.getResources();
GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(resources).setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
GenericDraweeHierarchyInflater.updateBuilder(builder, context, attrs);
setAspectRatio(builder.getDesiredAspectRatio());
setHierarchy(builder.build());
}
Aggregations