Interface ZoomableSharingView
-
- All Known Implementing Classes:
ZoomableImageView
public interface ZoomableSharingView
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceZoomableSharingView.ZoomableSharingViewActionListenerAction listener for touch events: single tap, long press, touch.static interfaceZoomableSharingView.ZoomableSharingViewStateListenerState listener: bitmap changes, scale changes.
-
Field Summary
Fields Modifier and Type Field Description static floatMAX_SCALE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddActionListener(ZoomableSharingView.ZoomableSharingViewActionListener listener)Adds private view action listener.voidaddOnTouchListener(android.view.View.OnTouchListener onTouchListener)Sets touch gesture listener on this view.voidaddStateListener(ZoomableSharingView.ZoomableSharingViewStateListener listener)Adds private view state listener.android.graphics.PointFgetActualBitmapTouch(android.graphics.PointF viewTouch)Calculates a bitmap coordinates from display touch.android.graphics.PointFgetActualDisplayTouch(android.graphics.PointF bitmapTouch)Calculates a display coordinates from the bitmap touch.android.graphics.MatrixgetCurrentMatrix()Returns current matrix of image.floatgetCurrentScale()Returns current scale of this view.android.graphics.BitmapgetImageBitmap()Returns bitmap image which was added to this view.android.graphics.RectFgetImageBoundsRect()Returns image bounds.voidremoveActionListener(ZoomableSharingView.ZoomableSharingViewActionListener listener)Removes private view action listener.voidremoveStateListener(ZoomableSharingView.ZoomableSharingViewStateListener listener)Removes private view state listener.voidsetImageBitmap(android.graphics.Bitmap bitmap, boolean original)Sets image bitmap for this view.
-
-
-
Field Detail
-
MAX_SCALE
static final float MAX_SCALE
- See Also:
- Constant Field Values
-
-
Method Detail
-
addActionListener
void addActionListener(ZoomableSharingView.ZoomableSharingViewActionListener listener)
Adds private view action listener.- Parameters:
listener- listener object to add.- See Also:
ZoomableSharingView.ZoomableSharingViewActionListener
-
removeActionListener
void removeActionListener(ZoomableSharingView.ZoomableSharingViewActionListener listener)
Removes private view action listener.- Parameters:
listener- listener object to remove.- See Also:
ZoomableSharingView.ZoomableSharingViewActionListener
-
addStateListener
void addStateListener(ZoomableSharingView.ZoomableSharingViewStateListener listener)
Adds private view state listener.- Parameters:
listener- listener object to add.- See Also:
ZoomableSharingView.ZoomableSharingViewStateListener
-
removeStateListener
void removeStateListener(ZoomableSharingView.ZoomableSharingViewStateListener listener)
Removes private view state listener.- Parameters:
listener- listener object to add.- See Also:
ZoomableSharingView.ZoomableSharingViewStateListener
-
addOnTouchListener
void addOnTouchListener(android.view.View.OnTouchListener onTouchListener)
Sets touch gesture listener on this view.- Parameters:
onTouchListener- listener object.- See Also:
View.OnTouchListener
-
getCurrentScale
float getCurrentScale()
Returns current scale of this view.- Returns:
- scale.
-
getCurrentMatrix
android.graphics.Matrix getCurrentMatrix()
Returns current matrix of image.- Returns:
- matrix.
-
getImageBoundsRect
android.graphics.RectF getImageBoundsRect()
Returns image bounds.- Returns:
- bounds.
-
getImageBitmap
android.graphics.Bitmap getImageBitmap()
Returns bitmap image which was added to this view.- Returns:
- bitmap image.
-
setImageBitmap
void setImageBitmap(android.graphics.Bitmap bitmap, boolean original)Sets image bitmap for this view. If original is true, all image bounds are recalculated and its positioning inside the view.- Parameters:
bitmap- object represents image.original- if true - image will be fitted inside this view.
-
getActualBitmapTouch
android.graphics.PointF getActualBitmapTouch(android.graphics.PointF viewTouch)
Calculates a bitmap coordinates from display touch. Returns null if the touch was outside the bitmap.- Parameters:
viewTouch- display touch point.- Returns:
- point coordinates.
-
getActualDisplayTouch
android.graphics.PointF getActualDisplayTouch(android.graphics.PointF bitmapTouch)
Calculates a display coordinates from the bitmap touch.- Parameters:
bitmapTouch- bitmap touch point.- Returns:
- point from bitmap touch.
-
-