Search in sources :

Example 56 with DraweeController

use of com.facebook.drawee.interfaces.DraweeController in project apps-android-commons by commons-app.

the class ZoomableActivity method init.

private void init() {
    if (imageUri != null) {
        GenericDraweeHierarchy hierarchy = GenericDraweeHierarchyBuilder.newInstance(getResources()).setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER).setProgressBarImage(new ProgressBarDrawable()).setProgressBarImageScaleType(ScalingUtils.ScaleType.FIT_CENTER).build();
        photo.setHierarchy(hierarchy);
        photo.setAllowTouchInterceptionWhileZoomed(true);
        photo.setIsLongpressEnabled(false);
        photo.setTapListener(new DoubleTapGestureListener(photo));
        DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(imageUri).setControllerListener(loadingListener).build();
        photo.setController(controller);
    }
}
Also used : ProgressBarDrawable(com.facebook.drawee.drawable.ProgressBarDrawable) DoubleTapGestureListener(fr.free.nrw.commons.media.zoomControllers.zoomable.DoubleTapGestureListener) GenericDraweeHierarchy(com.facebook.drawee.generic.GenericDraweeHierarchy) DraweeController(com.facebook.drawee.interfaces.DraweeController)

Aggregations

DraweeController (com.facebook.drawee.interfaces.DraweeController)56 ImageRequest (com.facebook.imagepipeline.request.ImageRequest)25 ResizeOptions (com.facebook.imagepipeline.common.ResizeOptions)10 Uri (android.net.Uri)8 SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)8 Animatable (android.graphics.drawable.Animatable)7 BaseControllerListener (com.facebook.drawee.controller.BaseControllerListener)6 GenericDraweeHierarchy (com.facebook.drawee.generic.GenericDraweeHierarchy)6 ImageInfo (com.facebook.imagepipeline.image.ImageInfo)5 ControllerListener (com.facebook.drawee.controller.ControllerListener)4 QualityInfo (com.facebook.imagepipeline.image.QualityInfo)4 Drawable (android.graphics.drawable.Drawable)3 Nullable (android.support.annotation.Nullable)3 ProgressBarDrawable (com.facebook.drawee.drawable.ProgressBarDrawable)3 Canvas (android.graphics.Canvas)2 ColorDrawable (android.graphics.drawable.ColorDrawable)2 View (android.view.View)2 ViewGroup (android.view.ViewGroup)2 AbstractDraweeController (com.facebook.drawee.controller.AbstractDraweeController)2 GenericDraweeHierarchyBuilder (com.facebook.drawee.generic.GenericDraweeHierarchyBuilder)2