當前位置: 首頁>>代碼示例>>Java>>正文


Java OnPhotoTapListener類代碼示例

本文整理匯總了Java中uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener的典型用法代碼示例。如果您正苦於以下問題:Java OnPhotoTapListener類的具體用法?Java OnPhotoTapListener怎麽用?Java OnPhotoTapListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OnPhotoTapListener類屬於uk.co.senab.photoview.PhotoViewAttacher包,在下文中一共展示了OnPhotoTapListener類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateView

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的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

示例2: onCreate

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);

	mapView = (MapView) findViewById(R.id.mapImageView);
	attacher = new PhotoViewAttacher(mapView);
	mapView.attacher = attacher;
	mapView.directionsView = (DirectionsView) findViewById(R.id.directions_view);
	attacher.setMaximumScale(6);

	// Listener called when it's tapped
	attacher.setOnPhotoTapListener(new OnPhotoTapListener() {

		@Override
		public void onPhotoTap(View arg0, float arg1, float arg2) {

			// X and Y positions relative to image. For example, middle of image
			// is 0.5, 0.5
			mapView.handleUserTap(arg1, arg2);
			mapView.invalidate();
		}
	});
	
}
 
開發者ID:luckytoilet,項目名稱:WATisRain,代碼行數:26,代碼來源:MainActivity.java

示例3: init

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
/**
 * 
 */
private void init() {
    if (!isInEditMode()) {
        mTagBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.tag);
        mTagWidth = mTagBitmap.getWidth();
        mTagHeight = mTagBitmap.getHeight();
    }

    setOnPhotoTapListener(new OnPhotoTapListener() {
        @Override
        public void onPhotoTap(View view, float x, float y) {
            if (mClickListener == null) {
                return;
            }
            RectF rectfF = getDisplayRect();
            float pointX = x * rectfF.width();
            float pointY = y * rectfF.height();
            //
            for (int i = 0; i < mTouchRects.length; i++) {
                if (mTouchRects[i].contains(pointX, pointY)) {
                    mClickListener.onTagClicked(i, mTags[i], mTouchRects[i]);
                }
            }
        }
    });
}
 
開發者ID:likebamboo,項目名稱:GravityShake,代碼行數:29,代碼來源:PhotoViewWithTag.java

示例4: onCreate

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView((int) R.layout.b8);
    ButterKnife.inject((Activity) this);
    this.mAttacher = new PhotoViewAttacher(this.mIvPhoto);
    this.mAttacher.setOnPhotoTapListener(new OnPhotoTapListener() {
        public void onPhotoTap(View view, float v, float v2) {
            DushouExampleActivity.this.finish();
        }
    });
    ImageLoader.getInstance().displayImage("", this.mIvPhoto, ImageLoaderOptions.global((int)
            R.drawable.rs));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:14,代碼來源:DushouExampleActivity.java

示例5: onCreateView

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) Log.d(getLogTag(), "onCreateView");
    mLayout = (RelativeLayout) inflater.inflate(
            R.layout.photoviewer_fragment, container, false);
    mVideoButton = (ImageView) mLayout.findViewById(
            R.id.play_video_overlay);
    mImageView = (ImageView) mLayout.findViewById(R.id.image);
    mAttacher = new PhotoViewAttacher(mImageView);
    mTextViewTitle = (TextView) mLayout.findViewById(R.id.textViewTitle);
    mTextViewAuthor = (TextView) mLayout.findViewById(R.id.textViewAuthor);
    mProgress = (ProgressBar) mLayout.findViewById(R.id.progress);

    mAttacher.setOnPhotoTapListener(new OnPhotoTapListener() {
        @Override
        public void onPhotoTap(View view, float x, float y) {
            BusProvider.getInstance().post(
                    new PhotoViewerVisibilityChangeEvent(
                            !mActionBar.isShowing(), PhotoViewerFragment.this)
            );
        }
    });

    /* If this fragment is new as part of a set, update it's overlay
     * visibility based on the state of the actionbar */
    setOverlayVisibility(mActionBar.isShowing());

    displayImage();

    return mLayout;
}
 
開發者ID:brk3,項目名稱:glimmr,代碼行數:33,代碼來源:PhotoViewerFragment.java

示例6: getOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
private OnPhotoTapListener getOnPhotoTapListener(final Activity activity) {
    return new OnPhotoTapListener() {

        @Override
        public void onPhotoTap(View view, float x, float y) {
            Intent intent = new Intent(Constants.Broadcast.BROADCAST_TOGGLE_FULLSCREEN);
            intent.putExtra(Constants.Extra.EXTRA_IS_SYSTEM_UI_VISIBLE, mSystemUiStateProvider.isSystemUiVisible());
            LocalBroadcastManager.getInstance(activity).sendBroadcast(intent);
        }
    };
}
 
開發者ID:antew,項目名稱:RedditInPictures,代碼行數:12,代碼來源:ImageViewerFragment.java

示例7: setOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
@Override
public void setOnPhotoTapListener(OnPhotoTapListener listener) {
    mAttacher.setOnPhotoTapListener(listener);
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:5,代碼來源:PhotoView.java

示例8: setOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
@Override
public void setOnPhotoTapListener(OnPhotoTapListener listener) {
	mAttacher.setOnPhotoTapListener(listener);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:PhotoView.java

示例9: getOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
@Override
@Deprecated
public OnPhotoTapListener getOnPhotoTapListener() {
    return mAttacher.getOnPhotoTapListener();
}
 
開發者ID:Loofer,項目名稱:Watermark,代碼行數:6,代碼來源:PhotoView.java

示例10: setOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
public void setOnPhotoTapListener(OnPhotoTapListener listener) {
    this.mAttacher.setOnPhotoTapListener(listener);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:4,代碼來源:PhotoView.java

示例11: getOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
public OnPhotoTapListener getOnPhotoTapListener() {
    return this.mAttacher.getOnPhotoTapListener();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:4,代碼來源:PhotoView.java

示例12: getOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
@Override
public OnPhotoTapListener getOnPhotoTapListener() {
    return mAttacher.getOnPhotoTapListener();
}
 
開發者ID:timothymiko,項目名稱:narrate-android,代碼行數:5,代碼來源:PhotoView.java

示例13: getOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
public OnPhotoTapListener getOnPhotoTapListener() {
    return mAttacher.getOnPhotoTapListener();
}
 
開發者ID:razerdp,項目名稱:FriendCircle,代碼行數:4,代碼來源:PhotoViewEx.java

示例14: getOnPhotoTapListener

import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //導入依賴的package包/類
@Override
public OnPhotoTapListener getOnPhotoTapListener() {
	return mAttacher.getOnPhotoTapListener();
}
 
開發者ID:hehonghui,項目名稱:AndroidImageBrowser,代碼行數:5,代碼來源:PhotoView.java


注:本文中的uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。