當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。