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


Java OnImageViewTouchSingleTapListener類代碼示例

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


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

示例1: onViewCreated

import it.sephiroth.android.library.imagezoom.ImageViewTouch.OnImageViewTouchSingleTapListener; //導入依賴的package包/類
@Override
public void onViewCreated( View v, Bundle savedInstanceState ) {

	super.onViewCreated( v, savedInstanceState );

	ImageViewTouch view = (ImageViewTouch) v.findViewById( R.id.image_viewer );

	view.setDisplayType( DisplayType.FIT_TO_SCREEN );

	view.setSingleTapListener( new OnImageViewTouchSingleTapListener() {

		@Override
		public void onSingleTapConfirmed() {
			ActionBar bar = getActivity().getActionBar();
			if( bar.isShowing() ) {
				bar.hide();
			} else {
				bar.show();
			}
		}

	} );

	createBitmap();

}
 
開發者ID:SilentCircle,項目名稱:silent-text-android,代碼行數:27,代碼來源:ImageViewerFragment.java

示例2: updateComponentData

import it.sephiroth.android.library.imagezoom.ImageViewTouch.OnImageViewTouchSingleTapListener; //導入依賴的package包/類
/**
 * 根據當前的索引更新組件的內容
 * 
 * */
private void updateComponentData(int position)
{

	Photo photo = photos.get(position);
	final View view = mListViews.get(position);
	ImageViewTouch zoomableImageView = (ImageViewTouch) view.findViewById(R.id.zoomableImageView);
	zoomableImageView.setOnLongClickListener(new OnLongClickListener()
	{

		@Override
		public boolean onLongClick(View v)
		{

			VibratorUtil.Vibrate(PhotoDetailActivity.this, 50);
			mActionMode = startActionMode(new ActionModeOfSave(ActionModeOfSave.ACTION_MODE_SAVE_PHOTO));
			return false;
		}
	});
	zoomableImageView.setSingleTapListener(new OnImageViewTouchSingleTapListener()
	{

		@Override
		public void onSingleTapConfirmed()
		{
			if (actionBar.isShowing())
			{

				actionBar.hide();
				hideDescribe();

			} else
			{

				actionBar.show();
				showDescribe();
			}
		}
	});

	final ProgressBar pbLoading = (ProgressBar) view.findViewById(R.id.pbLoading);
	imageLoader.displayImage(photo.image, zoomableImageView, ImageOptions.getTransPictureOption(0));// 加載圖片
	MyApplication.getImageLoader().displayImage(photo.image, zoomableImageView, ImageOptions.getTransPictureOption(0), new ImageLoadingListener()
	{

		@Override
		public void onLoadingStarted()
		{
			pbLoading.setVisibility(View.VISIBLE);
		}

		@Override
		public void onLoadingFailed(FailReason failReason)
		{
			view.findViewById(R.id.tvErrorTip).setVisibility(View.VISIBLE);
			pbLoading.setVisibility(View.GONE);
		}

		@Override
		public void onLoadingComplete(Bitmap loadedImage)
		{
			view.findViewById(R.id.tvErrorTip).setVisibility(View.GONE);
			pbLoading.setVisibility(View.GONE);
		}

		@Override
		public void onLoadingCancelled()
		{
			pbLoading.setVisibility(View.GONE);
		}
	});

	updateTitle(photo.position);
	setCurrentPhotoPosition(position);
	tvDesc.setText(photo.desc);
	tvAuthorAndDate.setText(new StringBuilder().append(photo.author.getName()).append(" 上傳於 ").append(photo.created));
	tvCommentNum.setText(photo.comments_count + "");
}
 
開發者ID:michaelye,項目名稱:DoubanOnline,代碼行數:82,代碼來源:PhotoDetailActivity.java


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