public class PhotoView extends android.widget.ImageView implements IPhotoView
android.widget.ImageView.ScaleTypeandroid.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListenerALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_RESOLVED_DEFAULT, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y| Constructor and Description |
|---|
PhotoView(android.content.Context context) |
PhotoView(android.content.Context context,
android.util.AttributeSet attr) |
PhotoView(android.content.Context context,
android.util.AttributeSet attr,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canZoom()
Returns true if the PhotoView is set to allow zooming of Photos.
|
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.
|
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.
|
protected void |
onDetachedFromWindow() |
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 finalRectangle)
Sets the Display Matrix of the currently displayed Drawable.
|
void |
setImageDrawable(android.graphics.drawable.Drawable drawable) |
void |
setImageResource(int resId) |
void |
setImageURI(android.net.Uri uri) |
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 l)
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 rotationDegree)
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.
|
clearColorFilter, drawableStateChanged, getAdjustViewBounds, getBaseline, getBaselineAlignBottom, getColorFilter, getCropToPadding, getDrawable, getImageAlpha, getImageMatrix, getMaxHeight, getMaxWidth, hasOverlappingRendering, invalidateDrawable, jumpDrawablesToCurrentState, onAttachedToWindow, onCreateDrawableState, onDraw, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onMeasure, onPopulateAccessibilityEvent, setAdjustViewBounds, setAlpha, setBaseline, setBaselineAlignBottom, setColorFilter, setColorFilter, setColorFilter, setCropToPadding, setFrame, setImageAlpha, setImageBitmap, setImageLevel, setImageMatrix, setImageState, setMaxHeight, setMaxWidth, setSelected, setVisibility, verifyDrawableaddChildrenForAccessibility, addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewsWithText, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasFocus, hasFocusable, hasOnClickListeners, hasTransientState, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDrawpublic PhotoView(android.content.Context context)
public PhotoView(android.content.Context context,
android.util.AttributeSet attr)
public PhotoView(android.content.Context context,
android.util.AttributeSet attr,
int defStyle)
public void setPhotoViewRotation(float rotationDegree)
IPhotoViewsetPhotoViewRotation in interface IPhotoViewrotationDegree - - Degree to rotate PhotoView by, should be in range 0 to 360public boolean canZoom()
IPhotoViewcanZoom in interface IPhotoViewpublic android.graphics.RectF getDisplayRect()
IPhotoViewgetDisplayRect in interface IPhotoViewpublic android.graphics.Matrix getDisplayMatrix()
IPhotoViewgetDisplayMatrix in interface IPhotoViewpublic boolean setDisplayMatrix(android.graphics.Matrix finalRectangle)
IPhotoViewsetDisplayMatrix in interface IPhotoView@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 float getScale()
IPhotoViewgetScale in interface IPhotoViewpublic android.widget.ImageView.ScaleType getScaleType()
IPhotoViewgetScaleType in interface IPhotoViewgetScaleType in class android.widget.ImageViewpublic 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 void setImageDrawable(android.graphics.drawable.Drawable drawable)
setImageDrawable in class android.widget.ImageViewpublic void setImageResource(int resId)
setImageResource in class android.widget.ImageViewpublic void setImageURI(android.net.Uri uri)
setImageURI in class android.widget.ImageViewpublic void setOnMatrixChangeListener(PhotoViewAttacher.OnMatrixChangedListener listener)
IPhotoViewsetOnMatrixChangeListener in interface IPhotoViewlistener - - Listener to be registered.public void setOnLongClickListener(android.view.View.OnLongClickListener l)
IPhotoViewsetOnLongClickListener in interface IPhotoViewsetOnLongClickListener in class android.view.Viewl - - Listener to be registered.public void setOnPhotoTapListener(PhotoViewAttacher.OnPhotoTapListener listener)
IPhotoViewsetOnPhotoTapListener in interface IPhotoViewlistener - - Listener to be registered.public 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 void setScaleType(android.widget.ImageView.ScaleType scaleType)
IPhotoViewImageView.ScaleType.setScaleType in interface IPhotoViewsetScaleType in class android.widget.ImageViewscaleType - - The desired scaling mode.public void setZoomable(boolean zoomable)
IPhotoViewsetZoomable in interface IPhotoViewzoomable - - Whether the zoom functionality is enabled.protected void onDetachedFromWindow()
onDetachedFromWindow in class android.widget.ImageViewCopyright © 2015 Hannes Dorfmann. All rights reserved.