本文整理汇总了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;
}
示例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();
}
});
}
示例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]);
}
}
}
});
}
示例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));
}
示例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;
}
示例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);
}
};
}
示例7: setOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
@Override
public void setOnPhotoTapListener(OnPhotoTapListener listener) {
mAttacher.setOnPhotoTapListener(listener);
}
示例8: setOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
@Override
public void setOnPhotoTapListener(OnPhotoTapListener listener) {
mAttacher.setOnPhotoTapListener(listener);
}
示例9: getOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
@Override
@Deprecated
public OnPhotoTapListener getOnPhotoTapListener() {
return mAttacher.getOnPhotoTapListener();
}
示例10: setOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
public void setOnPhotoTapListener(OnPhotoTapListener listener) {
this.mAttacher.setOnPhotoTapListener(listener);
}
示例11: getOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
public OnPhotoTapListener getOnPhotoTapListener() {
return this.mAttacher.getOnPhotoTapListener();
}
示例12: getOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
@Override
public OnPhotoTapListener getOnPhotoTapListener() {
return mAttacher.getOnPhotoTapListener();
}
示例13: getOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
public OnPhotoTapListener getOnPhotoTapListener() {
return mAttacher.getOnPhotoTapListener();
}
示例14: getOnPhotoTapListener
import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; //导入依赖的package包/类
@Override
public OnPhotoTapListener getOnPhotoTapListener() {
return mAttacher.getOnPhotoTapListener();
}