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 long |
ANIMATIONS_DURATION |
static float |
MAX_ZOOM |
static float |
OVERZOOM_FACTOR |
| Modifier and Type | Method and Description |
|---|---|
Settings |
disableBounds()
Disable bounds restrictions.
Calls to this method are counted, so if you called it N times you should call enableBounds() N times to re-enable bounds restrictions. |
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 |
enableBounds()
Re-enable bounds restrictions disabled by
disableBounds() method.Calls to this method are counted, so if you called disableBounds() N times
you should call this method N times to re-enable bounds restrictions. |
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. |
long |
getAnimationsDuration() |
float |
getDoubleTapZoom() |
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 |
isExitEnabled() |
boolean |
isFillViewport() |
boolean |
isGesturesEnabled() |
boolean |
isPanEnabled() |
boolean |
isRestrictBounds() |
boolean |
isRestrictRotation() |
boolean |
isRotationEnabled() |
boolean |
isZoomEnabled() |
Settings |
setAnimationsDuration(long duration)
Duration of animations.
|
Settings |
setDoubleTapEnabled(boolean enabled)
Sets whether zooming by double tap is enabled or not.
|
Settings |
setDoubleTapZoom(float doubleTapZoom)
Setting double tap zoom level, should not be greater than
getMaxZoom(). |
Settings |
setExitEnabled(boolean enabled)
Sets whether to detect and animate exit from gesture views.
|
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 width,
int height)
Setting full image size.
|
Settings |
setMaxZoom(float maxZoom)
Setting max zoom level.
|
Settings |
setMovementArea(int width,
int height)
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 restrict)
Deprecated.
Use
disableBounds() and enableBounds() methods instead. |
Settings |
setRestrictRotation(boolean restrict)
Sets whether image rotation should stick to 90 degrees intervals or can be free.
|
Settings |
setRotationEnabled(boolean enabled)
Sets whether rotation gesture is enabled or not.
|
Settings |
setViewport(int width,
int height)
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 static final long ANIMATIONS_DURATION
public Settings setViewport(int width, int height)
GestureView.public Settings setMovementArea(int width, int height)
public Settings setImage(int width, int height)
GestureView.public Settings setMaxZoom(float maxZoom)
MAX_ZOOM.public Settings setDoubleTapZoom(float doubleTapZoom)
getMaxZoom().
Defaults to getMaxZoom() if <= 0.
Default value is -1.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 DP.public 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 setRestrictRotation(boolean restrict)
isRestrictBounds() is true as well.
Default value is false.public Settings setDoubleTapEnabled(boolean enabled)
public Settings setExitEnabled(boolean enabled)
public Settings disableGestures()
enableGestures() N times to re-enable all gestures.
Useful when you need to 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 disableBounds()
enableBounds() N times to re-enable bounds restrictions.
Useful when you need to temporary disable bounds restrictions during animation.
See also enableBounds()public Settings enableBounds()
disableBounds() method.disableBounds() N times
you should call this method N times to re-enable bounds restrictions.
See also disableBounds()@Deprecated public Settings setRestrictBounds(boolean restrict)
disableBounds() and enableBounds() methods instead.public Settings setAnimationsDuration(long duration)
public int getViewportW()
public int getViewportH()
public int getMovementAreaW()
public int getMovementAreaH()
public int getImageW()
public int getImageH()
public float getMaxZoom()
public float getDoubleTapZoom()
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 isRestrictRotation()
public boolean isDoubleTapEnabled()
public boolean isExitEnabled()
public boolean isGesturesEnabled()
public boolean isRestrictBounds()
public long getAnimationsDuration()
public boolean isEnabled()
public boolean hasImageSize()
public boolean hasViewportSize()