Search in sources :

Example 1 with DoubleTapGestureListener

use of fr.free.nrw.commons.media.zoomControllers.zoomable.DoubleTapGestureListener 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

ProgressBarDrawable (com.facebook.drawee.drawable.ProgressBarDrawable)1 GenericDraweeHierarchy (com.facebook.drawee.generic.GenericDraweeHierarchy)1 DraweeController (com.facebook.drawee.interfaces.DraweeController)1 DoubleTapGestureListener (fr.free.nrw.commons.media.zoomControllers.zoomable.DoubleTapGestureListener)1