本文整理汇总了Java中com.facebook.samples.zoomable.DoubleTapGestureListener类的典型用法代码示例。如果您正苦于以下问题:Java DoubleTapGestureListener类的具体用法?Java DoubleTapGestureListener怎么用?Java DoubleTapGestureListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoubleTapGestureListener类属于com.facebook.samples.zoomable包,在下文中一共展示了DoubleTapGestureListener类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: instantiateItem
import com.facebook.samples.zoomable.DoubleTapGestureListener; //导入依赖的package包/类
@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])
.setCallerContext("ZoomableApp-MyPagerAdapter")
.build();
zoomableDraweeView.setController(controller);
page.requestLayout();
return page;
}
示例2: onCreateView
import com.facebook.samples.zoomable.DoubleTapGestureListener; //导入依赖的package包/类
@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;
}