use of com.facebook.samples.zoomable.ZoomableDraweeView in project fresco by facebook.
the class MyPagerAdapter method destroyItem.
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
FrameLayout page = (FrameLayout) container.getChildAt(position);
ZoomableDraweeView zoomableDraweeView = (ZoomableDraweeView) page.getChildAt(0);
zoomableDraweeView.setController(null);
}
use of com.facebook.samples.zoomable.ZoomableDraweeView 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