OnSwipe
class OnSwipe
Container for holding swipe information
Summary
Constants |
|
|---|---|
const Int |
|
const Int |
|
const Int |
|
const Int |
DRAG_CLOCKWISE = 6 |
const Int |
DRAG_DOWN = 1 |
const Int |
DRAG_END = 5 |
const Int |
DRAG_LEFT = 2 |
const Int |
DRAG_RIGHT = 3 |
const Int |
DRAG_START = 4 |
const Int |
DRAG_UP = 0 |
const Int |
|
const Int |
|
const Int |
|
const Int |
|
const Int |
|
const Int |
ON_UP_DECELERATE = 4 |
const Int |
|
const Int |
|
const Int |
|
const Int |
ON_UP_STOP = 3 |
const Int |
SIDE_BOTTOM = 3 |
const Int |
SIDE_END = 6 |
const Int |
SIDE_LEFT = 1 |
const Int |
SIDE_MIDDLE = 4 |
const Int |
SIDE_RIGHT = 2 |
const Int |
SIDE_START = 5 |
const Int |
SIDE_TOP = 0 |
const Int |
|
const Int |
|
const Int |
|
const Int |
Public constructors |
|---|
OnSwipe() |
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! |
setLimitBoundsTo(id: Int)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! |
setNestedScrollFlags(flags: Int)Various flag to control behaviours of nested scroll FLAG_DISABLE_POST_SCROLL = 1; FLAG_DISABLE_SCROLL = 2; |
OnSwipe! |
setOnTouchUp(mode: Int)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! |
setTouchAnchorId(side: Int)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! |
setTouchAnchorSide(side: Int)This side of the view that matches the drag movement. |
OnSwipe! |
setTouchRegionId(side: Int) |
Constants
COMPLETE_MODE_CONTINUOUS_VELOCITY
const val COMPLETE_MODE_CONTINUOUS_VELOCITY = 0: Int
Public constructors
Public functions
getSpringBoundary
fun getSpringBoundary(): Int
The behaviour at the boundaries 0 and 1
| Returns | |
|---|---|
Int |
getSpringMass
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
fun getSpringStiffness(): Float
get the stiffness of the spring
| Returns | |
|---|---|
Float |
NaN if not set |
getSpringStopThreshold
fun getSpringStopThreshold(): Float
The threshold for spring motion to stop.
| Returns | |
|---|---|
Float |
setAutoCompleteMode
fun setAutoCompleteMode(autoCompleteMode: Int): Unit
sets the behaviour at the boundaries 0 and 1 COMPLETE_MODE_CONTINUOUS_VELOCITY = 0; COMPLETE_MODE_SPRING = 1;
setDragDirection
fun setDragDirection(dragDirection: Int): OnSwipe!
The direction of the drag.
| Parameters | |
|---|---|
dragDirection: Int |
| Returns | |
|---|---|
OnSwipe! |
setDragScale
fun setDragScale(dragScale: Int): OnSwipe!
Normally 1 this can be tweaked to make the acceleration faster
| Parameters | |
|---|---|
dragScale: Int |
| Returns | |
|---|---|
OnSwipe! |
setDragThreshold
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
fun setLimitBoundsTo(id: Int): OnSwipe!
Only allow touch actions to be initiated within this region
| Parameters | |
|---|---|
id: Int |
| Returns | |
|---|---|
OnSwipe! |
setMaxAcceleration
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
fun setMaxVelocity(maxVelocity: Int): OnSwipe!
The maximum velocity (Change in progress per second) animation can achieve
| Parameters | |
|---|---|
maxVelocity: Int |
| Returns | |
|---|---|
OnSwipe! |
setMoveWhenScrollAtTop
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
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
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
fun setRotateCenter(rotationCenterId: Int): OnSwipe!
The view to center the rotation about
| Parameters | |
|---|---|
rotationCenterId: Int |
| Returns | |
|---|---|
OnSwipe! |
this |
setSpringBoundary
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
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
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
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
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
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! |