本文整理汇总了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();
}
示例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 + "");
}