本文整理汇总了Java中uk.co.senab.photoview.PhotoViewAttacher.setOnPhotoTapListener方法的典型用法代码示例。如果您正苦于以下问题:Java PhotoViewAttacher.setOnPhotoTapListener方法的具体用法?Java PhotoViewAttacher.setOnPhotoTapListener怎么用?Java PhotoViewAttacher.setOnPhotoTapListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uk.co.senab.photoview.PhotoViewAttacher
的用法示例。
在下文中一共展示了PhotoViewAttacher.setOnPhotoTapListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTap
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
private void onTap() {
mPhotoViewAttacher = new PhotoViewAttacher(imageView);
mPhotoViewAttacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
if (isShowing) {
isShowing = false;
toolbar.animate().translationY(-toolbar.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
imagesHorizontalList.animate().translationY(imagesHorizontalList.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
} else {
isShowing = true;
toolbar.animate().translationY(0).setInterpolator(new DecelerateInterpolator()).start();
imagesHorizontalList.animate().translationY(0).setInterpolator(new DecelerateInterpolator()).start();
}
}
@Override
public void onOutsidePhotoTap() {
}
});
}
示例2: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_photo_show_layout);
photoView = (PhotoView) findViewById(R.id.photoview);
Glide.with(context).load(imgpath).into(photoView);
mAttacher = new PhotoViewAttacher(photoView);
mAttacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
}
@Override
public void onOutsidePhotoTap() {
}
});
}
示例3: onCreateView
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View v = inflater.inflate(R.layout.gushi_image_detail_fragment, container, false);
mImageView = (ImageView) v.findViewById(R.id.image);
mAttacher = new PhotoViewAttacher(mImageView);
mAttacher.setOnPhotoTapListener(new OnPhotoTapListener() {
@Override
public void onPhotoTap(View arg0, float arg1, float arg2) {
getActivity().finish();
}
});
progressBar = (ProgressBar) v.findViewById(R.id.loading);
return v;
}
示例4: onCreateView
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_image_detail, container, false);
mImageView = (ImageView) v.findViewById(R.id.image_browse_image);
textTip = (TextView) v.findViewById(R.id.image_browse_tip);
progressBar = (ProgressBar) v.findViewById(R.id.image_browse_loading);
mAttacher = new PhotoViewAttacher(mImageView);
mAttacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View arg0, float arg1, float arg2) {
getActivity().finish();
}
@Override
public void onOutsidePhotoTap() {
}
});
return v;
}
示例5: onCreateView
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_image, null);
ViewUtils.inject(this, view);
mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
mAttacher = new PhotoViewAttacher(mImageView);
mAttacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View arg0, float arg1, float arg2) {
getActivity().finish();
}
});
return view;
}
示例6: initMeizhiView
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
private void initMeizhiView() {
setTitle(DateUtil.toDateTimeStr(meizi.publishedAt));
ivMeizhi.setImageDrawable(ShareElement.shareDrawable);
ViewCompat.setTransitionName(ivMeizhi, PanConfig.TRANSLATE_GIRL_VIEW);
attacher = new PhotoViewAttacher(ivMeizhi);
Glide.with(this).load(meizi.url).asBitmap().into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
ivMeizhi.setImageBitmap(resource);
attacher.update();
girl = resource;
}
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable) {
ivMeizhi.setImageDrawable(errorDrawable);
}
});
attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
hideOrShowToolBar();
}
});
}
示例7: onCreateView
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View v = inflater.inflate(R.layout.image_detail_fragment, container, false);
mImageView = (ImageView) v.findViewById(R.id.image);
mAttacher = new PhotoViewAttacher(mImageView);
mAttacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View arg0, float arg1, float arg2) {
getActivity().finish();
}
});
progressBar = (ProgressBar) v.findViewById(R.id.loading);
return v;
}
示例8: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.spine_crescent);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例9: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.ashland);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例10: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.iron_delta);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例11: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.manus_peak);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例12: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.skim_junction);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例13: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.line_harvest);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例14: instantiateItem
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
@SuppressWarnings("NewApi")
public Object instantiateItem(ViewGroup container, int position) {
View v = inflater.inflate(R.layout.view_pdf_page, container, false);
ImageView iv = (ImageView) v.findViewById(R.id.imageView);
if (renderer == null || getCount() < position) {
return v;
}
PdfRenderer.Page page = getPDFPage(renderer, position);
Bitmap bitmap = bitmapContainer.get(position);
page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
page.close();
PhotoViewAttacher attacher = new PhotoViewAttacher(iv);
attacher.setScale(scale.getScale(), scale.getCenterX(), scale.getCenterY(), true);
attacher.setOnMatrixChangeListener(this);
attachers.put(position, new WeakReference<PhotoViewAttacher>(attacher));
iv.setImageBitmap(bitmap);
attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
if (pageClickListener != null) {
pageClickListener.onPageTap(view, x, y);
}
}
});
attacher.update();
container.addView(v, 0);
return v;
}
示例15: initMeizhiView
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
private void initMeizhiView() {
setTitle(DateUtil.toDateTimeStr(meizi.publishedAt));
ivMeizhi.setImageDrawable(ShareElement.shareDrawable);
ViewCompat.setTransitionName(ivMeizhi, GankConfig.TRANSLATE_GIRL_VIEW);
attacher = new PhotoViewAttacher(ivMeizhi);
Glide.with(this).load(meizi.url).asBitmap().into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
ivMeizhi.setImageBitmap(resource);
attacher.update();
girl = resource;
}
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable) {
ivMeizhi.setImageDrawable(errorDrawable);
}
});
attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
hideOrShowToolBar();
}
@Override
public void onOutsidePhotoTap() {
hideOrShowToolBar();
}
});
}