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


Java PhotoViewAttacher.setOnPhotoTapListener方法代码示例

本文整理汇总了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() {

        }
    });
}
 
开发者ID:alhazmy13,项目名称:MediaGallery,代码行数:24,代码来源:ViewPagerAdapter.java

示例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() {

        }
    });
}
 
开发者ID:wanliyang1990,项目名称:AndroidPickPhotoDialog,代码行数:21,代码来源:ImgShowDialog.java

示例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;
}
 
开发者ID:macyuan,项目名称:TAG,代码行数:18,代码来源:ImageDetailFragment.java

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

示例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;
}
 
开发者ID:bornbeauty,项目名称:mengwa,代码行数:21,代码来源:ImageDetailFragment.java

示例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();
    }
  });
}
 
开发者ID:Panl,项目名称:Gank.io,代码行数:26,代码来源:MeizhiActivity.java

示例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;
}
 
开发者ID:edanel,项目名称:dbMeizi,代码行数:18,代码来源:ImageDetailFragment.java

示例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());
}
 
开发者ID:netskink,项目名称:Dust514SkirmishMaps,代码行数:19,代码来源:SpineCrescentActivity.java

示例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());
}
 
开发者ID:netskink,项目名称:Dust514SkirmishMaps,代码行数:19,代码来源:AshlandActivity.java

示例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());
}
 
开发者ID:netskink,项目名称:Dust514SkirmishMaps,代码行数:19,代码来源:IronDeltaActivity.java

示例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());
}
 
开发者ID:netskink,项目名称:Dust514SkirmishMaps,代码行数:19,代码来源:ManusPeakActivity.java

示例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());
}
 
开发者ID:netskink,项目名称:Dust514SkirmishMaps,代码行数:19,代码来源:SkimJunctionActivity.java

示例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());
}
 
开发者ID:netskink,项目名称:Dust514SkirmishMaps,代码行数:19,代码来源:LineHarvestActivity.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:PDFPagerAdapter.java

示例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();
        }
    });
}
 
开发者ID:xybCoder,项目名称:gank,代码行数:31,代码来源:MeiZhiActivity.java


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