当前位置: 首页>>代码示例>>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;未经允许,请勿转载。