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