use of com.facebook.samples.zoomable.DoubleTapGestureListener in project fresco by facebook.
the class MyPagerAdapter method instantiateItem.
@Override
public Object instantiateItem(ViewGroup container, int position) {
FrameLayout page = (FrameLayout) container.getChildAt(position);
if (page == null) {
return null;
}
ZoomableDraweeView zoomableDraweeView = (ZoomableDraweeView) page.findViewById(R.id.zoomableView);
zoomableDraweeView.setAllowTouchInterceptionWhileZoomed(mAllowSwipingWhileZoomed);
// needed for double tap to zoom
zoomableDraweeView.setIsLongpressEnabled(false);
zoomableDraweeView.setTapListener(new DoubleTapGestureListener(zoomableDraweeView));
DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(SAMPLE_URIS[position % SAMPLE_URIS.length]).build();
zoomableDraweeView.setController(controller);
page.requestLayout();
return page;
}
Aggregations