Search in sources :

Example 1 with GenericDraweeHierarchyBuilder

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);
}
Also used : GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) GenericDraweeHierarchy(com.facebook.drawee.generic.GenericDraweeHierarchy) ActorCreator(im.actor.runtime.actors.ActorCreator)

Example 2 with GenericDraweeHierarchyBuilder

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());
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) CoverOverlayDrawable(im.actor.sdk.view.avatar.CoverOverlayDrawable)

Example 3 with GenericDraweeHierarchyBuilder

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());
}
Also used : GenericDraweeHierarchy(com.facebook.drawee.generic.GenericDraweeHierarchy) GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) VolleyDraweeHolder(com.facebook.samples.comparison.holders.VolleyDraweeHolder) InstrumentedDraweeView(com.facebook.samples.comparison.instrumentation.InstrumentedDraweeView)

Example 4 with GenericDraweeHierarchyBuilder

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;
}
Also used : DoubleTapGestureListener(com.facebook.samples.zoomable.DoubleTapGestureListener) GenericDraweeHierarchy(com.facebook.drawee.generic.GenericDraweeHierarchy) GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) VideoView(android.widget.VideoView) MotionEvent(android.view.MotionEvent)

Example 5 with GenericDraweeHierarchyBuilder

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());
}
Also used : GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) Resources(android.content.res.Resources)

Aggregations

GenericDraweeHierarchyBuilder (com.facebook.drawee.generic.GenericDraweeHierarchyBuilder)19 GenericDraweeHierarchy (com.facebook.drawee.generic.GenericDraweeHierarchy)14 Resources (android.content.res.Resources)5 RoundingParams (com.facebook.drawee.generic.RoundingParams)4 ProgressBarDrawable (com.facebook.drawee.drawable.ProgressBarDrawable)3 Canvas (android.graphics.Canvas)2 Drawable (android.graphics.drawable.Drawable)2 Uri (android.net.Uri)2 DraweeController (com.facebook.drawee.interfaces.DraweeController)2 ResizeOptions (com.facebook.imagepipeline.common.ResizeOptions)2 ImageRequest (com.facebook.imagepipeline.request.ImageRequest)2 InstrumentedDraweeView (com.facebook.samples.comparison.instrumentation.InstrumentedDraweeView)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 RecyclerView (android.support.v7.widget.RecyclerView)1 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 VideoView (android.widget.VideoView)1 GFImageView (cn.finalteam.galleryfinal.widget.GFImageView)1 DraweeHierarchy (com.facebook.drawee.interfaces.DraweeHierarchy)1