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


Java PhotoViewAttacher.setOnViewTapListener方法代码示例

本文整理汇总了Java中uk.co.senab.photoview.PhotoViewAttacher.setOnViewTapListener方法的典型用法代码示例。如果您正苦于以下问题:Java PhotoViewAttacher.setOnViewTapListener方法的具体用法?Java PhotoViewAttacher.setOnViewTapListener怎么用?Java PhotoViewAttacher.setOnViewTapListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uk.co.senab.photoview.PhotoViewAttacher的用法示例。


在下文中一共展示了PhotoViewAttacher.setOnViewTapListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateView

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View contentView = inflater.inflate(R.layout.fragment_image_preview, container, false);
    final ImageView imageView = (ImageView) contentView.findViewById(R.id.preview_image);
    final PhotoViewAttacher mAttacher = new PhotoViewAttacher(imageView);
    Glide.with(container.getContext())
            .load(new File(getArguments().getString(PATH)))
            .asBitmap()
            .into(new SimpleTarget<Bitmap>(480, 800) {
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                    imageView.setImageBitmap(resource);
                    mAttacher.update();
                }
            });
    mAttacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
        @Override
        public void onViewTap(View view, float x, float y) {
            ImagePreviewActivity activity = (ImagePreviewActivity) getActivity();
            activity.switchBarVisibility();
        }
    });
    return contentView;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:ImagePreviewFragment.java

示例2: instantiateItem

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
public View instantiateItem(ViewGroup container, int position) {
    MQImageView imageView = new MQImageView(container.getContext());
    container.addView(imageView, -1, -1);
    final PhotoViewAttacher photoViewAttacher = new PhotoViewAttacher(imageView);
    photoViewAttacher.setOnViewTapListener(MQPhotoPreviewActivity.this);
    imageView.setDrawableChangedCallback(new MQImageView$OnDrawableChangedCallback() {
        public void onDrawableChanged() {
            photoViewAttacher.update();
        }
    });
    MQConfig.getImageLoader(MQPhotoPreviewActivity.this).displayImage(imageView, (String)
            MQPhotoPreviewActivity.this.mPreviewImages.get(position), R.drawable
            .mq_ic_holder_dark, R.drawable.mq_ic_holder_dark, MQUtils.getScreenWidth
            (MQPhotoPreviewActivity.this), MQUtils.getScreenHeight(MQPhotoPreviewActivity
            .this), null);
    return imageView;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:MQPhotoPreviewActivity.java

示例3: instantiateItem

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
public View instantiateItem(ViewGroup container, int position) {
    MQImageView imageView = new MQImageView(container.getContext());
    container.addView(imageView, -1, -1);
    final PhotoViewAttacher photoViewAttacher = new PhotoViewAttacher(imageView);
    photoViewAttacher.setOnViewTapListener(MQPhotoPickerPreviewActivity.this);
    imageView.setDrawableChangedCallback(new MQImageView$OnDrawableChangedCallback() {
        public void onDrawableChanged() {
            photoViewAttacher.update();
        }
    });
    MQConfig.getImageLoader(MQPhotoPickerPreviewActivity.this).displayImage(imageView,
            (String) MQPhotoPickerPreviewActivity.this.mPreviewImages.get(position), R
                    .drawable.mq_ic_holder_dark, R.drawable.mq_ic_holder_dark, MQUtils
                    .getScreenWidth(MQPhotoPickerPreviewActivity.this), MQUtils
                    .getScreenHeight(MQPhotoPickerPreviewActivity.this), null);
    return imageView;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:MQPhotoPickerPreviewActivity.java

示例4: setupPhotoAttacher

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
private void setupPhotoAttacher() {
    mPhotoViewAttacher = new PhotoViewAttacher(mImageView);
    mPhotoViewAttacher.setOnViewTapListener((view, v, v1) -> hideOrShowToolbar());
    // @formatter:off
    mPhotoViewAttacher.setOnLongClickListener(v -> {
        new AlertDialog.Builder(PictureActivity.this)
                .setMessage(getString(R.string.ask_saving_picture))
                .setNegativeButton(android.R.string.cancel,
                        (dialog, which) -> dialog.dismiss())
                .setPositiveButton(android.R.string.ok,
                        (dialog, which) -> {
                            saveImageToGallery();
                            dialog.dismiss();
                        })
                .show();
        // @formatter:on
        return true;
    });
}
 
开发者ID:benchegnzhou,项目名称:MeiZi_App,代码行数:20,代码来源:PictureActivity.java

示例5: onCreate

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_image_review);
    ButterKnife.inject(this);

    attacher = new PhotoViewAttacher(image);
    attacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
        @Override
        public void onViewTap(View view, float v, float v2) {
            finish();
        }
    });
    final String path = getIntent().getExtras().getString("path");
    displayImage("file://" + path, image);

}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:20,代码来源:ImageReviewActivity.java

示例6: onCreate

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //如果没有虚拟按键则设置为全屏
    if (!UIUtil.isHasNavigationBar(this)) {
        getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LOW_PROFILE |
                View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
                View.SYSTEM_UI_FLAG_FULLSCREEN);
    }
    if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.addFlags(LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(R.color.black);
    }
    mAttacher = new PhotoViewAttacher(mPhoto);
    mAttacher.setOnViewTapListener(new OnViewTapListener() {
        @Override public void onViewTap(View view, float x, float y) {
            hideBottomOption();
        }
    });
}
 
开发者ID:wavever,项目名称:GankLock,代码行数:22,代码来源:PhotoActivity.java

示例7: onCreateView

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View contentView = inflater.inflate(R.layout.fragment_image_preview, container, false);
        final ImageView imageView = (ImageView) contentView.findViewById(R.id.preview_image);
        final PhotoViewAttacher mAttacher = new PhotoViewAttacher(imageView);
        Glide.with(container.getContext())
//                .load(new File(getArguments().getString(PATH)))
                .load(getArguments().getString(PATH))
                .asBitmap()
                .into(new SimpleTarget<Bitmap>(480, 800) {
                    @Override
                    public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                        imageView.setImageBitmap(resource);
                        mAttacher.update();
                    }
                });
        mAttacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
            @Override
            public void onViewTap(View view, float x, float y) {
                ImagePreviewActivity activity = (ImagePreviewActivity) getActivity();
                activity.switchBarVisibility();
            }
        });
        return contentView;
    }
 
开发者ID:yushiwo,项目名称:Universal-Image-Selector,代码行数:27,代码来源:ImagePreviewFragment.java

示例8: setupPhotoAttacher

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
private void setupPhotoAttacher() {
        mPhotoViewAttacher = new PhotoViewAttacher(mImageView);
        mPhotoViewAttacher.setOnViewTapListener((view, v, v1) -> onBackPressed());
        mPhotoViewAttacher.setOnLongClickListener(v -> {
            new AlertDialog.Builder(PictureActivity.this)
                    .setMessage(getString(R.string.ask_saving_picture))
                    .setNegativeButton(android.R.string.cancel,
                            (dialog, which) -> dialog.dismiss())
                    .setPositiveButton(android.R.string.ok,
                            (dialog, which) -> {
                                saveImageToGallery();
//                                TODO:保存图片逻辑
                                dialog.dismiss();
                            })
                    .show();
            return true;
        });
    }
 
开发者ID:Dimon94,项目名称:GanWuMei,代码行数:19,代码来源:PictureActivity.java

示例9: onCreateView

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View rootView = inflater.inflate(R.layout.photo_browser_image, container, false);

      imageView = (ImageView)rootView.findViewById(R.id.imageView);
      textView = (TextView)rootView.findViewById(R.id.textView);
      
      attacher = new PhotoViewAttacher(imageView);
      
      attacher.setOnViewTapListener(new OnViewTapListener() {			
	@Override
	public void onViewTap(View view, float x, float y) {
		((Loader)getActivity()).toggleActionBar();
	}
});
      
      
      if (caption == null || caption.isEmpty())
      	textView.setVisibility(View.INVISIBLE);
      else
      	textView.setText(caption);
      
      return rootView;
  }
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:27,代码来源:PhotoBrowserImage.java

示例10: onResourceReady

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
    mCircleProgressView.setVisibility(View.GONE);
    mCircleProgressView.stopSpinning();
    mImageView.setImageDrawable(resource);
    mPhotoViewAttacher = new PhotoViewAttacher(mImageView);
    mPhotoViewAttacher.setOnViewTapListener((view, v, v1) -> getActivity().finish());

    return false;
}
 
开发者ID:HotBitmapGG,项目名称:Acg,代码行数:11,代码来源:ImageDetailsFragment.java

示例11: setAttacher

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
public void setAttacher(ImageView imageView) {
    attacher = new PhotoViewAttacher(imageView);
    attacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
        @Override
        public void onViewTap(View view, float x, float y) {
            imageOnClick(view);
        }
    });
}
 
开发者ID:kollerlukas,项目名称:Camera-Roll-Android-App,代码行数:10,代码来源:GifViewHolder.java

示例12: onLoadingFailed

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onLoadingFailed(String imageUri, View view,
		FailReason failReason) {
	mImageView.setScaleType(ImageView.ScaleType.CENTER);
	mProgress.setVisibility(View.GONE);
	PhotoViewAttacher photo = new PhotoViewAttacher(mImageView);
	photo.setMaxScale(8);
	photo.setOnPhotoTapListener(this);
	photo.setOnViewTapListener(this);
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:11,代码来源:MediaDetailFragment.java

示例13: onLoadingComplete

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
	mImageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
	mProgress.setVisibility(View.GONE);
	PhotoViewAttacher photo = new PhotoViewAttacher(mImageView);
	photo.setMaxScale(10);
	photo.setOnPhotoTapListener(this);
	photo.setOnViewTapListener(this);
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:10,代码来源:MediaDetailFragment.java

示例14: onCreate

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    PictureActivityBinding binding =
            DataBindingUtil.setContentView(this, R.layout.picture_activity);

    String mGirlUrl = getIntent().getExtras().getString("url");

    ViewCompat.setTransitionName(binding.ivPhoto, "girl");

    Picasso.with(this).load(mGirlUrl)
            .into(binding.ivPhoto);

    background = new ColorDrawable(Color.BLACK);

    binding.pullBackLayout.getRootView().setBackground(background);

    PhotoViewAttacher mViewAttacher = new PhotoViewAttacher(binding.ivPhoto);

    binding.pullBackLayout.setPullCallBack(this);

    mViewAttacher.setOnViewTapListener((view, x, y) -> {
        if (systemUiIsShow) {
            hideSystemUI();
            systemUiIsShow = false;
        } else {
            showSystemUI();
            systemUiIsShow = true;
        }
    });
}
 
开发者ID:Assassinss,项目名称:pretty-girl,代码行数:32,代码来源:PictureActivity.java

示例15: onCreate

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_viewer);
  unbinder = ButterKnife.bind(this);

  toolbar.inflateMenu(R.menu.menu_viewer);
  toolbar.setOnMenuItemClickListener(this);
  toolbar.setNavigationIcon(R.drawable.ic_close);
  toolbar.setNavigationOnClickListener(v -> finish());

  attacher = new PhotoViewAttacher(image);
  attacher.setOnPhotoTapListener(this);
  attacher.setOnViewTapListener((view, x, y) -> onPhotoTap(null, 0f, 0f));

  Glide.with(this).load(new File(getIntent().getData().getPath())).into(mTarget);

  if (toolbar != null) {
    new Handler()
        .postDelayed(
            () -> {
              if (toolbar != null) {
                onPhotoTap(null, 0f, 0f);
              }
            },
            2000);
  }
}
 
开发者ID:afollestad,项目名称:photo-affix,代码行数:29,代码来源:ViewerActivity.java


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