class OnSwipe


Container for holding swipe information

Summary

Public constructors

Public functions

Int
Int
Float
Float
Int
Float
Float
Boolean
Int
Int
Int
Int

The behaviour at the boundaries 0 and 1

Float
Float

Get the mass of the spring. the m in "a = (-k*x-c*v)/m" equation for the acceleration of a spring

Float

get the stiffness of the spring

Float

The threshold for spring motion to stop.

Int
Int
Int
Unit
setAutoCompleteMode(autoCompleteMode: Int)

sets the behaviour at the boundaries 0 and 1 COMPLETE_MODE_CONTINUOUS_VELOCITY = 0; COMPLETE_MODE_SPRING = 1;

OnSwipe!
setDragDirection(dragDirection: Int)

The direction of the drag.

OnSwipe!
setDragScale(dragScale: Int)

Normally 1 this can be tweaked to make the acceleration faster

OnSwipe!
setDragThreshold(dragThreshold: Int)

This sets the threshold before the animation is kicked off.

OnSwipe!

Only allow touch actions to be initiated within this region

OnSwipe!
setMaxAcceleration(maxAcceleration: Int)

The maximum acceleration and deceleration of the animation (Change in Change in progress per second) Faster makes the object seem lighter and quicker

OnSwipe!
setMaxVelocity(maxVelocity: Int)

The maximum velocity (Change in progress per second) animation can achieve

OnSwipe!
setMoveWhenScrollAtTop(moveWhenScrollAtTop: Boolean)

When collaborating with a NestedScrollView do you progress form 0-1 only when the scroll view is at the top.

OnSwipe!

Various flag to control behaviours of nested scroll FLAG_DISABLE_POST_SCROLL = 1; FLAG_DISABLE_SCROLL = 2;

OnSwipe!

Configures what happens when the user releases on mouse up.

OnSwipe!
setRotateCenter(rotationCenterId: Int)

The view to center the rotation about

OnSwipe!
setSpringBoundary(springBoundary: Int)

The behaviour at the boundaries 0 and 1.

OnSwipe!
setSpringDamping(springDamping: Float)

Set the damping of the spring if using spring. c in "a = (-k*x-c*v)/m" equation for the acceleration of a spring

OnSwipe!
setSpringMass(springMass: Float)

Set the Mass of the spring if using spring. m in "a = (-k*x-c*v)/m" equation for the acceleration of a spring

OnSwipe!
setSpringStiffness(springStiffness: Float)

set the stiffness of the spring if using spring.

OnSwipe!
setSpringStopThreshold(springStopThreshold: Float)

set the threshold for spring motion to stop.

OnSwipe!

The id of the view who's movement is matched to your drag If not specified it will map to a linear movement across the width of the motionLayout

OnSwipe!

This side of the view that matches the drag movement.

OnSwipe!

Constants

COMPLETE_MODE_CONTINUOUS_VELOCITY

Added in 2.2.0
const val COMPLETE_MODE_CONTINUOUS_VELOCITY = 0: Int

COMPLETE_MODE_SPRING

Added in 2.2.0
const val COMPLETE_MODE_SPRING = 1: Int

DRAG_ANTICLOCKWISE

Added in 2.2.0
const val DRAG_ANTICLOCKWISE = 7: Int

DRAG_CLOCKWISE

Added in 2.2.0
const val DRAG_CLOCKWISE = 6: Int

DRAG_DOWN

Added in 2.2.0
const val DRAG_DOWN = 1: Int

DRAG_END

Added in 2.2.0
const val DRAG_END = 5: Int

DRAG_LEFT

Added in 2.2.0
const val DRAG_LEFT = 2: Int

DRAG_RIGHT

Added in 2.2.0
const val DRAG_RIGHT = 3: Int

DRAG_START

Added in 2.2.0
const val DRAG_START = 4: Int

DRAG_UP

Added in 2.2.0
const val DRAG_UP = 0: Int

FLAG_DISABLE_POST_SCROLL

Added in 2.2.0
const val FLAG_DISABLE_POST_SCROLL = 1: Int

FLAG_DISABLE_SCROLL

Added in 2.2.0
const val FLAG_DISABLE_SCROLL = 2: Int

ON_UP_AUTOCOMPLETE

Added in 2.2.0
const val ON_UP_AUTOCOMPLETE = 0: Int

ON_UP_AUTOCOMPLETE_TO_END

Added in 2.2.0
const val ON_UP_AUTOCOMPLETE_TO_END = 2: Int

ON_UP_AUTOCOMPLETE_TO_START

Added in 2.2.0
const val ON_UP_AUTOCOMPLETE_TO_START = 1: Int

ON_UP_DECELERATE

Added in 2.2.0
const val ON_UP_DECELERATE = 4: Int

ON_UP_DECELERATE_AND_COMPLETE

Added in 2.2.0
const val ON_UP_DECELERATE_AND_COMPLETE = 5: Int

ON_UP_NEVER_TO_END

Added in 2.2.0
const val ON_UP_NEVER_TO_END = 7: Int

ON_UP_NEVER_TO_START

Added in 2.2.0
const val ON_UP_NEVER_TO_START = 6: Int

ON_UP_STOP

Added in 2.2.0
const val ON_UP_STOP = 3: Int

SIDE_BOTTOM

Added in 2.2.0
const val SIDE_BOTTOM = 3: Int

SIDE_END

Added in 2.2.0
const val SIDE_END = 6: Int

SIDE_LEFT

Added in 2.2.0
const val SIDE_LEFT = 1: Int

SIDE_MIDDLE

Added in 2.2.0
const val SIDE_MIDDLE = 4: Int

SIDE_RIGHT

Added in 2.2.0
const val SIDE_RIGHT = 2: Int

SIDE_START

Added in 2.2.0
const val SIDE_START = 5: Int

SIDE_TOP

Added in 2.2.0
const val SIDE_TOP = 0: Int

SPRING_BOUNDARY_BOUNCEBOTH

Added in 2.2.0
const val SPRING_BOUNDARY_BOUNCEBOTH = 3: Int

SPRING_BOUNDARY_BOUNCEEND

Added in 2.2.0
const val SPRING_BOUNDARY_BOUNCEEND = 2: Int

SPRING_BOUNDARY_BOUNCESTART

Added in 2.2.0
const val SPRING_BOUNDARY_BOUNCESTART = 1: Int

SPRING_BOUNDARY_OVERSHOOT

Added in 2.2.0
const val SPRING_BOUNDARY_OVERSHOOT = 0: Int

Public constructors

OnSwipe

Added in 2.2.0
OnSwipe()

Public functions

getAutoCompleteMode

Added in 2.2.0
fun getAutoCompleteMode(): Int

getDragDirection

Added in 2.2.0
fun getDragDirection(): Int

getDragScale

Added in 2.2.0
fun getDragScale(): Float

getDragThreshold

Added in 2.2.0
fun getDragThreshold(): Float

getLimitBoundsTo

Added in 2.2.0
fun getLimitBoundsTo(): Int

getMaxAcceleration

Added in 2.2.0
fun getMaxAcceleration(): Float

getMaxVelocity

Added in 2.2.0
fun getMaxVelocity(): Float

getMoveWhenScrollAtTop

Added in 2.2.0
fun getMoveWhenScrollAtTop(): Boolean

getNestedScrollFlags

Added in 2.2.0
fun getNestedScrollFlags(): Int

getOnTouchUp

Added in 2.2.0
fun getOnTouchUp(): Int

getRotationCenterId

Added in 2.2.0
fun getRotationCenterId(): Int

getSpringBoundary

Added in 2.2.0
fun getSpringBoundary(): Int

The behaviour at the boundaries 0 and 1

Returns
Int

getSpringDamping

Added in 2.2.0
fun getSpringDamping(): Float

getSpringMass

Added in 2.2.0
fun getSpringMass(): Float

Get the mass of the spring. the m in "a = (-k*x-c*v)/m" equation for the acceleration of a spring

Returns
Float

getSpringStiffness

Added in 2.2.0
fun getSpringStiffness(): Float

get the stiffness of the spring

Returns
Float

NaN if not set

getSpringStopThreshold

Added in 2.2.0
fun getSpringStopThreshold(): Float

The threshold for spring motion to stop.

Returns
Float

getTouchAnchorId

Added in 2.2.0
fun getTouchAnchorId(): Int

getTouchAnchorSide

Added in 2.2.0
fun getTouchAnchorSide(): Int

getTouchRegionId

Added in 2.2.0
fun getTouchRegionId(): Int

setAutoCompleteMode

Added in 2.2.0
fun setAutoCompleteMode(autoCompleteMode: Int): Unit

sets the behaviour at the boundaries 0 and 1 COMPLETE_MODE_CONTINUOUS_VELOCITY = 0; COMPLETE_MODE_SPRING = 1;

setDragDirection

Added in 2.2.0
fun setDragDirection(dragDirection: Int): OnSwipe!

The direction of the drag.

Parameters
dragDirection: Int
Returns
OnSwipe!

setDragScale

Added in 2.2.0
fun setDragScale(dragScale: Int): OnSwipe!

Normally 1 this can be tweaked to make the acceleration faster

Parameters
dragScale: Int
Returns
OnSwipe!

setDragThreshold

Added in 2.2.0
fun setDragThreshold(dragThreshold: Int): OnSwipe!

This sets the threshold before the animation is kicked off. It is important when have multi state animations the have some play before the System decides which animation to jump on.

Parameters
dragThreshold: Int
Returns
OnSwipe!

setLimitBoundsTo

Added in 2.2.0
fun setLimitBoundsTo(id: Int): OnSwipe!

Only allow touch actions to be initiated within this region

Parameters
id: Int
Returns
OnSwipe!

setMaxAcceleration

Added in 2.2.0
fun setMaxAcceleration(maxAcceleration: Int): OnSwipe!

The maximum acceleration and deceleration of the animation (Change in Change in progress per second) Faster makes the object seem lighter and quicker

Parameters
maxAcceleration: Int
Returns
OnSwipe!

setMaxVelocity

Added in 2.2.0
fun setMaxVelocity(maxVelocity: Int): OnSwipe!

The maximum velocity (Change in progress per second) animation can achieve

Parameters
maxVelocity: Int
Returns
OnSwipe!

setMoveWhenScrollAtTop

Added in 2.2.0
fun setMoveWhenScrollAtTop(moveWhenScrollAtTop: Boolean): OnSwipe!

When collaborating with a NestedScrollView do you progress form 0-1 only when the scroll view is at the top.

Parameters
moveWhenScrollAtTop: Boolean
Returns
OnSwipe!

setNestedScrollFlags

Added in 2.2.0
fun setNestedScrollFlags(flags: Int): OnSwipe!

Various flag to control behaviours of nested scroll FLAG_DISABLE_POST_SCROLL = 1; FLAG_DISABLE_SCROLL = 2;

Parameters
flags: Int
Returns
OnSwipe!

setOnTouchUp

Added in 2.2.0
fun setOnTouchUp(mode: Int): OnSwipe!

Configures what happens when the user releases on mouse up. One of: ON_UP_AUTOCOMPLETE, ON_UP_AUTOCOMPLETE_TO_START, ON_UP_AUTOCOMPLETE_TO_END, ON_UP_STOP, ON_UP_DECELERATE, ON_UP_DECELERATE_AND_COMPLETE

Parameters
mode: Int

default = ON_UP_AUTOCOMPLETE

Returns
OnSwipe!

setRotateCenter

Added in 2.2.0
fun setRotateCenter(rotationCenterId: Int): OnSwipe!

The view to center the rotation about

Parameters
rotationCenterId: Int
Returns
OnSwipe!

this

setSpringBoundary

Added in 2.2.0
fun setSpringBoundary(springBoundary: Int): OnSwipe!

The behaviour at the boundaries 0 and 1. SPRING_BOUNDARY_OVERSHOOT = 0; SPRING_BOUNDARY_BOUNCE_START = 1; SPRING_BOUNDARY_BOUNCE_END = 2; SPRING_BOUNDARY_BOUNCE_BOTH = 3;

Parameters
springBoundary: Int
Returns
OnSwipe!

setSpringDamping

Added in 2.2.0
fun setSpringDamping(springDamping: Float): OnSwipe!

Set the damping of the spring if using spring. c in "a = (-k*x-c*v)/m" equation for the acceleration of a spring

Parameters
springDamping: Float
Returns
OnSwipe!

this

setSpringMass

Added in 2.2.0
fun setSpringMass(springMass: Float): OnSwipe!

Set the Mass of the spring if using spring. m in "a = (-k*x-c*v)/m" equation for the acceleration of a spring

Parameters
springMass: Float
Returns
OnSwipe!

this

setSpringStiffness

Added in 2.2.0
fun setSpringStiffness(springStiffness: Float): OnSwipe!

set the stiffness of the spring if using spring. If this is set the swipe will use a spring return system. If set to NaN it will revert to the norm system. K in "a = (-k*x-c*v)/m" equation for the acceleration of a spring

Parameters
springStiffness: Float
Returns
OnSwipe!

setSpringStopThreshold

Added in 2.2.0
fun setSpringStopThreshold(springStopThreshold: Float): OnSwipe!

set the threshold for spring motion to stop. This is in change in progress / second If the spring will never go above that threshold again it will stop.

Parameters
springStopThreshold: Float
Returns
OnSwipe!

setTouchAnchorId

Added in 2.2.0
fun setTouchAnchorId(side: Int): OnSwipe!

The id of the view who's movement is matched to your drag If not specified it will map to a linear movement across the width of the motionLayout

Parameters
side: Int
Returns
OnSwipe!

setTouchAnchorSide

Added in 2.2.0
fun setTouchAnchorSide(side: Int): OnSwipe!

This side of the view that matches the drag movement. Only meaning full if the object changes size during the movement. (rotation is not considered)

Parameters
side: Int
Returns
OnSwipe!

setTouchRegionId

Added in 2.2.0
fun setTouchRegionId(side: Int): OnSwipe!
Parameters
side: Int
Returns
OnSwipe!