当前位置: 首页>>代码示例>>Java>>正文


Java DoubleTapGestureListener类代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:MyPagerAdapter.java

示例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;
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:23,代码来源:GalleryItemFragment.java


注:本文中的com.facebook.samples.zoomable.DoubleTapGestureListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。