public class Settings
extends java.lang.Object
GestureController and for StateController.
Required settings are viewport size (setViewport(int, int))
and image size setImage(int, int)| Modifier and Type | Class and Description |
|---|---|
static class |
Settings.Fit |
| Modifier and Type | Field and Description |
|---|---|
static float |
MAX_ZOOM |
static float |
OVERZOOM_FACTOR |
| Modifier and Type | Method and Description |
|---|---|
Settings |
disableGestures()
Disable all gestures.
Calls to this method are counted, so if you called it N times you should call enableGestures() N times to re-enable all gestures. |
Settings |
enableGestures()
Re-enable all gestures disabled by
disableGestures() method.Calls to this method are counted, so if you called disableGestures() N times
you should call this method N times to re-enable all gestures. |
Settings.Fit |
getFitMethod() |
int |
getGravity() |
int |
getImageH() |
int |
getImageW() |
float |
getMaxZoom() |
int |
getMovementAreaH() |
int |
getMovementAreaW() |
float |
getOverscrollDistanceX() |
float |
getOverscrollDistanceY() |
float |
getOverzoomFactor() |
int |
getViewportH() |
int |
getViewportW() |
boolean |
hasImageSize() |
boolean |
hasViewportSize() |
boolean |
isDoubleTapEnabled() |
boolean |
isEnabled()
Whether at least one of pan, zoom, rotation or double tap are enabled or not
|
boolean |
isFillViewport() |
boolean |
isGesturesEnabled() |
boolean |
isPanEnabled() |
boolean |
isRestrictBounds() |
boolean |
isRotationEnabled() |
boolean |
isZoomEnabled() |
Settings |
setDoubleTapEnabled(boolean enabled)
Sets whether zooming by double tap is enabled or not.
|
Settings |
setFillViewport(boolean isFitViewport)
If set to true small image will be scaled to fit entire viewport (or entire movement area
if it was set) even if this will require zoom level above max zoom level.
|
Settings |
setFitMethod(Settings.Fit fitMethod)
Setting image fitting method within viewport area.
|
Settings |
setGravity(int gravity)
Setting image gravity inside viewport area.
|
Settings |
setImage(int w,
int h)
Setting full image size.
|
Settings |
setMaxZoom(float maxZoom)
Setting max zoom level.
|
Settings |
setMovementArea(int w,
int h)
Setting movement area size.
|
Settings |
setOverscrollDistance(android.content.Context context,
float distanceXDp,
float distanceYDp)
Same as
setOverscrollDistance(float, float) but accepts distance in DP |
Settings |
setOverscrollDistance(float distanceX,
float distanceY)
Setting overscroll distance in pixels.
|
Settings |
setOverzoomFactor(float factor)
Setting overzoom factor.
|
Settings |
setPanEnabled(boolean enabled)
Sets whether panning is enabled or not.
|
Settings |
setRestrictBounds(boolean isRestrictBounds)
Sets whether image transformations should be kept in bounds or not.
|
Settings |
setRotationEnabled(boolean enabled)
Sets whether rotation gesture is enabled or not.
|
Settings |
setViewport(int w,
int h)
Setting viewport size.
|
Settings |
setZoomEnabled(boolean enabled)
Sets whether zooming is enabled or not.
|
public static final float MAX_ZOOM
public static final float OVERZOOM_FACTOR
public Settings setViewport(int w, int h)
GestureView.public Settings setMovementArea(int w, int h)
public Settings setImage(int w, int h)
GestureView.public Settings setMaxZoom(float maxZoom)
MAX_ZOOM.public Settings setOverzoomFactor(float factor)
OVERZOOM_FACTOR.public Settings setOverscrollDistance(float distanceX, float distanceY)
public Settings setOverscrollDistance(android.content.Context context, float distanceXDp, float distanceYDp)
setOverscrollDistance(float, float) but accepts distance in DPpublic Settings setFillViewport(boolean isFitViewport)
public Settings setGravity(int gravity)
Gravity.CENTER.public Settings setFitMethod(Settings.Fit fitMethod)
Settings.Fit.INSIDE.public Settings setPanEnabled(boolean enabled)
public Settings setZoomEnabled(boolean enabled)
public Settings setRotationEnabled(boolean enabled)
public Settings setDoubleTapEnabled(boolean enabled)
public Settings disableGestures()
enableGestures() N times to re-enable all gestures.
Useful when you need temporary disable touch gestures during animation or image loading.
See also enableGestures()public Settings enableGestures()
disableGestures() method.disableGestures() N times
you should call this method N times to re-enable all gestures.
See also disableGestures()public Settings setRestrictBounds(boolean isRestrictBounds)
false during animation to make it smoother,
but you should ensure end state of animation is within bounds.
Default value is true.public int getViewportW()
public int getViewportH()
public int getMovementAreaW()
public int getMovementAreaH()
public int getImageW()
public int getImageH()
public float getMaxZoom()
public float getOverzoomFactor()
public float getOverscrollDistanceX()
public float getOverscrollDistanceY()
public boolean isFillViewport()
public int getGravity()
public Settings.Fit getFitMethod()
public boolean isPanEnabled()
public boolean isZoomEnabled()
public boolean isRotationEnabled()
public boolean isDoubleTapEnabled()
public boolean isGesturesEnabled()
public boolean isRestrictBounds()
public boolean isEnabled()
public boolean hasImageSize()
public boolean hasViewportSize()