本文整理匯總了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 + "");
}