public class PhotoViewAttacher extends Object implements IPhotoView, android.view.View.OnTouchListener, OnGestureListener, android.view.GestureDetector.OnDoubleTapListener, android.view.ViewTreeObserver.OnGlobalLayoutListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
PhotoViewAttacher.OnMatrixChangedListener
Interface definition for a callback to be invoked when the internal
Matrix has changed for this View.
|
static interface |
PhotoViewAttacher.OnPhotoTapListener
Interface definition for a callback to be invoked when the Photo is
tapped with a single tap.
|
static interface |
PhotoViewAttacher.OnViewTapListener
Interface definition for a callback to be invoked when the ImageView is
tapped with a single tap.
|
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_MAX_SCALE |
static float |
DEFAULT_MID_SCALE |
static float |
DEFAULT_MIN_SCALE |
| Constructor and Description |
|---|
PhotoViewAttacher(android.widget.ImageView imageView) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canZoom()
Returns true if the PhotoView is set to allow zooming of Photos.
|
void |
cleanup()
Clean-up the resources attached to this object.
|
android.graphics.Matrix |
getDisplayMatrix()
Gets the Display Matrix of the currently displayed Drawable.
|
android.graphics.RectF |
getDisplayRect()
Gets the Display Rectangle of the currently displayed Drawable.
|
protected android.graphics.Matrix |
getDrawMatrix() |
android.widget.ImageView |
getImageView() |
float |
getMaximumScale() |
float |
getMaxScale()
Deprecated.
|
float |
getMediumScale() |
float |
getMidScale()
Deprecated.
|
float |
getMinimumScale() |
float |
getMinScale()
Deprecated.
|
float |
getScale()
Returns the current scale value
|
android.widget.ImageView.ScaleType |
getScaleType()
Return the current scale type in use by the ImageView.
|
boolean |
onDoubleTap(android.view.MotionEvent ev) |
boolean |
onDoubleTapEvent(android.view.MotionEvent e) |
void |
onDrag(float dx,
float dy) |
void |
onFling(float startX,
float startY,
float velocityX,
float velocityY) |
void |
onGlobalLayout() |
void |
onScale(float scaleFactor,
float focusX,
float focusY) |
boolean |
onSingleTapConfirmed(android.view.MotionEvent e) |
boolean |
onTouch(android.view.View v,
android.view.MotionEvent ev) |
void |
setAllowParentInterceptOnEdge(boolean allow)
Whether to allow the ImageView's parent to intercept the touch event when the photo is scroll to it's horizontal edge.
|
boolean |
setDisplayMatrix(android.graphics.Matrix finalMatrix)
Sets the Display Matrix of the currently displayed Drawable.
|
void |
setMaximumScale(float maximumScale)
Sets the maximum scale level.
|
void |
setMaxScale(float maxScale)
Deprecated.
|
void |
setMediumScale(float mediumScale) |
void |
setMidScale(float midScale)
Deprecated.
|
void |
setMinimumScale(float minimumScale)
Sets the minimum scale level.
|
void |
setMinScale(float minScale)
Deprecated.
|
void |
setOnLongClickListener(android.view.View.OnLongClickListener listener)
Register a callback to be invoked when the Photo displayed by this view is long-pressed.
|
void |
setOnMatrixChangeListener(PhotoViewAttacher.OnMatrixChangedListener listener)
Register a callback to be invoked when the Matrix has changed for this
View.
|
void |
setOnPhotoTapListener(PhotoViewAttacher.OnPhotoTapListener listener)
Register a callback to be invoked when the Photo displayed by this View
is tapped with a single tap.
|
void |
setOnViewTapListener(PhotoViewAttacher.OnViewTapListener listener)
Register a callback to be invoked when the View is tapped with a single
tap.
|
void |
setPhotoViewRotation(float degrees)
Enables rotation via PhotoView internal functions.
|
void |
setScale(float scale)
Changes the current scale to the specified value.
|
void |
setScale(float scale,
boolean animate)
Changes the current scale to the specified value.
|
void |
setScale(float scale,
float focalX,
float focalY,
boolean animate)
Changes the current scale to the specified value, around the given focal point.
|
void |
setScaleType(android.widget.ImageView.ScaleType scaleType)
Controls how the image should be resized or moved to match the size of
the ImageView.
|
void |
setZoomable(boolean zoomable)
Allows you to enable/disable the zoom functionality on the ImageView.
|
void |
update() |
public static final float DEFAULT_MAX_SCALE
public static final float DEFAULT_MID_SCALE
public static final float DEFAULT_MIN_SCALE
public final boolean canZoom()
IPhotoViewcanZoom in interface IPhotoViewpublic final void cleanup()
View.onDetachedFromWindow() or from
android.app.Activity#onDestroy(). This is automatically called if
you are using uk.co.senab.photoview.PhotoView.public final android.graphics.RectF getDisplayRect()
IPhotoViewgetDisplayRect in interface IPhotoViewpublic boolean setDisplayMatrix(android.graphics.Matrix finalMatrix)
IPhotoViewsetDisplayMatrix in interface IPhotoViewpublic void setPhotoViewRotation(float degrees)
IPhotoViewsetPhotoViewRotation in interface IPhotoViewdegrees - - Degree to rotate PhotoView by, should be in range 0 to 360public final android.widget.ImageView getImageView()
@Deprecated public float getMinScale()
IPhotoViewIPhotoView.getMinimumScale() instead, this will be removed in future releasegetMinScale in interface IPhotoViewImageView.ScaleType.public float getMinimumScale()
getMinimumScale in interface IPhotoViewImageView.ScaleType.@Deprecated public float getMidScale()
IPhotoViewIPhotoView.getMediumScale() instead, this will be removed in future releasegetMidScale in interface IPhotoViewImageView.ScaleType.public float getMediumScale()
getMediumScale in interface IPhotoViewImageView.ScaleType.@Deprecated public float getMaxScale()
IPhotoViewIPhotoView.getMaximumScale() instead, this will be removed in future releasegetMaxScale in interface IPhotoViewImageView.ScaleType.public float getMaximumScale()
getMaximumScale in interface IPhotoViewImageView.ScaleType.public final float getScale()
IPhotoViewgetScale in interface IPhotoViewpublic final android.widget.ImageView.ScaleType getScaleType()
IPhotoViewgetScaleType in interface IPhotoViewpublic final boolean onDoubleTap(android.view.MotionEvent ev)
onDoubleTap in interface android.view.GestureDetector.OnDoubleTapListenerpublic final boolean onDoubleTapEvent(android.view.MotionEvent e)
onDoubleTapEvent in interface android.view.GestureDetector.OnDoubleTapListenerpublic final void onDrag(float dx,
float dy)
onDrag in interface OnGestureListenerpublic final void onFling(float startX,
float startY,
float velocityX,
float velocityY)
onFling in interface OnGestureListenerpublic final void onGlobalLayout()
onGlobalLayout in interface android.view.ViewTreeObserver.OnGlobalLayoutListenerpublic final void onScale(float scaleFactor,
float focusX,
float focusY)
onScale in interface OnGestureListenerpublic final boolean onSingleTapConfirmed(android.view.MotionEvent e)
onSingleTapConfirmed in interface android.view.GestureDetector.OnDoubleTapListenerpublic final boolean onTouch(android.view.View v,
android.view.MotionEvent ev)
onTouch in interface android.view.View.OnTouchListenerpublic void setAllowParentInterceptOnEdge(boolean allow)
IPhotoViewsetAllowParentInterceptOnEdge in interface IPhotoView@Deprecated public void setMinScale(float minScale)
IPhotoViewIPhotoView.setMinimumScale(float minimumScale) instead, this will be removed in future release
Sets the minimum scale level. What this value represents depends on the current ImageView.ScaleType.setMinScale in interface IPhotoViewpublic void setMinimumScale(float minimumScale)
IPhotoViewImageView.ScaleType.setMinimumScale in interface IPhotoView@Deprecated public void setMidScale(float midScale)
IPhotoViewIPhotoView.setMediumScale(float mediumScale) instead, this will be removed in future release
Sets the middle scale level. What this value represents depends on the current ImageView.ScaleType.setMidScale in interface IPhotoViewpublic void setMediumScale(float mediumScale)
setMediumScale in interface IPhotoView@Deprecated public void setMaxScale(float maxScale)
IPhotoViewIPhotoView.setMaximumScale(float maximumScale) instead, this will be removed in future release
Sets the maximum scale level. What this value represents depends on the current ImageView.ScaleType.setMaxScale in interface IPhotoViewpublic void setMaximumScale(float maximumScale)
IPhotoViewImageView.ScaleType.setMaximumScale in interface IPhotoViewpublic final void setOnLongClickListener(android.view.View.OnLongClickListener listener)
IPhotoViewsetOnLongClickListener in interface IPhotoViewlistener - - Listener to be registered.public final void setOnMatrixChangeListener(PhotoViewAttacher.OnMatrixChangedListener listener)
IPhotoViewsetOnMatrixChangeListener in interface IPhotoViewlistener - - Listener to be registered.public final void setOnPhotoTapListener(PhotoViewAttacher.OnPhotoTapListener listener)
IPhotoViewsetOnPhotoTapListener in interface IPhotoViewlistener - - Listener to be registered.public final void setOnViewTapListener(PhotoViewAttacher.OnViewTapListener listener)
IPhotoViewsetOnViewTapListener in interface IPhotoViewlistener - - Listener to be registered.public void setScale(float scale)
IPhotoViewsetScale in interface IPhotoViewscale - - Value to scale topublic void setScale(float scale,
boolean animate)
IPhotoViewsetScale in interface IPhotoViewscale - - Value to scale toanimate - - Whether to animate the scalepublic void setScale(float scale,
float focalX,
float focalY,
boolean animate)
IPhotoViewsetScale in interface IPhotoViewscale - - Value to scale tofocalX - - X Focus PointfocalY - - Y Focus Pointanimate - - Whether to animate the scalepublic final void setScaleType(android.widget.ImageView.ScaleType scaleType)
IPhotoViewImageView.ScaleType.setScaleType in interface IPhotoViewscaleType - - The desired scaling mode.public final void setZoomable(boolean zoomable)
IPhotoViewsetZoomable in interface IPhotoViewzoomable - - Whether the zoom functionality is enabled.public final void update()
public android.graphics.Matrix getDisplayMatrix()
IPhotoViewgetDisplayMatrix in interface IPhotoViewprotected android.graphics.Matrix getDrawMatrix()
Copyright © 2015 Hannes Dorfmann. All rights reserved.