Class AxisDragModifierBase
Provides base class for dragging operations on axes See Also: XAxisDragModifier, YAxisDragModifier
Inheritance
Inherited Members
Namespace:
Assembly: .dll
Syntax
public abstract class AxisDragModifierBase extends GestureModifierBase
Constructors
AxisDragModifierBase()
Declaration
public AxisDragModifierBase()
Methods
applyScaleToRange(IRange applyTo, float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
When overridden in a derived class, calculates an output IRange to apply to the associated IAxis which is given in the input parameters.
Declaration
protected abstract void applyScaleToRange(IRange applyTo, float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
Parameters
Type | Name | Description |
---|---|---|
IRange | applyTo | The IRange instance which will be scaled. |
float | xDelta | The x delta value. |
float | yDelta | The y delta value. |
boolean | isSecondHalf | Boolean flag to determine which side of the axis is scaled. |
IAxis | axis | The IAxis instance being operated on. |
getApplicableAxes()
Declaration
protected abstract Iterable<IAxis> getApplicableAxes()
Returns
Type | Description |
---|---|
Iterable<IAxis> | The collection of IAxis which this modifier may be applicable on. |
getDragMode()
Gets the AxisDragMode of the AxisDragModifierBase. This modifier may be used to scale or pan the AxisCore#getVisibleRange() creating a scrolling or panning effect.
Declaration
public final AxisDragModifierBase.AxisDragMode getDragMode()
Returns
Type | Description |
---|---|
AxisDragModifierBase.AxisDragMode | The AxisDragMode which is used. |
getIsSecondHalf(float x, float y, RectF axisBounds, boolean isHorizontalAxis)
Gets whether the specified mouse point is within the second (right-most or top-most) half of the Axis bounds.
Declaration
protected boolean getIsSecondHalf(float x, float y, RectF axisBounds, boolean isHorizontalAxis)
Parameters
Type | Name | Description |
---|---|---|
float | x | The x value of the MotionEvent. |
float | y | The y value of the MotionEvent. |
android.graphics.RectF | axisBounds | The axis bounds. |
boolean | isHorizontalAxis | Value, which indicates whether current axis is horizontal or not. |
Returns
Type | Description |
---|---|
boolean | True if the point is within the second (right-most or top-most) half of the axis bounds, else false. |
getMinTouchArea()
Gets minimal area of recognition (min height for horizontal axis or min width for vertical), where user click or touch triggers zoom behavior.
Declaration
public final float getMinTouchArea()
Returns
Type | Description |
---|---|
float | The minimal area of recognition, where user click or touch triggers zoom behavior. |
onCancel(MotionEvent e)
Called when MotionEvent#ACTION_CANCEL event occurs
Declaration
protected void onCancel(MotionEvent e)
Parameters
Type | Name | Description |
---|---|---|
android.view.MotionEvent | e |
Overrides
onDown(MotionEvent e)
Declaration
public boolean onDown(MotionEvent e)
Parameters
Type | Name | Description |
---|---|---|
android.view.MotionEvent | e |
Returns
Type | Description |
---|---|
boolean |
Overrides
onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
Declaration
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
Parameters
Type | Name | Description |
---|---|---|
android.view.MotionEvent | e1 | |
android.view.MotionEvent | e2 | |
float | distanceX | |
float | distanceY |
Returns
Type | Description |
---|---|
boolean |
Overrides
onUp(MotionEvent e)
Called when MotionEvent#ACTION_UP event occurs
Declaration
protected void onUp(MotionEvent e)
Parameters
Type | Name | Description |
---|---|---|
android.view.MotionEvent | e |
Overrides
performPan(float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
Performs a pan on the associated IAxis which is given in the input parameters.
Declaration
protected abstract void performPan(float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
Parameters
Type | Name | Description |
---|---|---|
float | xDelta | The x delta value. |
float | yDelta | The y delta value. |
boolean | isSecondHalf | Boolean flag to determine which side of the axis is panned. |
IAxis | axis | The IAxis instance being operated on. |
performScale(float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
Performs a Scale on the associated IAxis which is given in the input parameters.
Declaration
protected void performScale(float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
Parameters
Type | Name | Description |
---|---|---|
float | xDelta | The x delta value. |
float | yDelta | The y delta value. |
boolean | isSecondHalf | Boolean flag to determine which side of the axis is scaled. |
IAxis | axis | The IAxis instance on which the scale operation will be performed. |
setDragMode(AxisDragModifierBase.AxisDragMode dragMode)
Sets the AxisDragMode of the AxisDragModifierBase. This modifier may be used to scale or pan the AxisCore#getVisibleRange() creating a scrolling or panning effect.
Declaration
public final void setDragMode(AxisDragModifierBase.AxisDragMode dragMode)
Parameters
Type | Name | Description |
---|---|---|
AxisDragModifierBase.AxisDragMode | dragMode | The new AxisDragMode of the AxisDragModifierBase. |
setMinTouchArea(float minTouchArea)
Sets minimal area of recognition (min height for horizontal axis or min width for vertical), where user click or touch triggers zoom behavior.
Declaration
public final void setMinTouchArea(float minTouchArea)
Parameters
Type | Name | Description |
---|---|---|
float | minTouchArea | The minimal area of recognition, where user click or touch triggers zoom behavior. |