class Transition : TypedValues


Summary

Nested types

Constants

const Int
END = 1
const Int
const Int
START = 0

Public constructors

Transition(dpToPixel: CorePixelDp)

Public functions

Unit
addCustomColor(state: Int, widgetId: String!, property: String!, color: Int)
Unit
addCustomFloat(state: Int, widgetId: String!, property: String!, value: Float)
Unit
addKeyAttribute(target: String!, bundle: TypedBundle!)
Unit
addKeyAttribute(
    target: String!,
    bundle: TypedBundle!,
    custom: Array<CustomVariable!>!
)

Add a key attribute and the custom variables into the

Unit
addKeyCycle(target: String!, bundle: TypedBundle!)
Unit
addKeyPosition(target: String!, bundle: TypedBundle!)
Unit
addKeyPosition(target: String!, frame: Int, type: Int, x: Float, y: Float)
Unit
Unit
Boolean
Float
dragToProgress(
    currentProgress: Float,
    baseW: Int,
    baseH: Int,
    dx: Float,
    dy: Float
)

Converts from xy drag to progress This should be used till touch up

Unit
fillKeyPositions(
    frame: WidgetFrame!,
    x: FloatArray!,
    y: FloatArray!,
    pos: FloatArray!
)
Transition.KeyPosition!
findNextPosition(target: String!, frameNumber: Int)
Transition.KeyPosition!
findPreviousPosition(target: String!, frameNumber: Int)
Int

This gets the auto transition mode being used

WidgetFrame!

Used in debug draw

WidgetFrame!
getEnd(id: String!)
Int
getId(name: String!)
WidgetFrame!

Used after the interpolation

WidgetFrame!
Int
Int
Interpolator!

This gets the interpolator being used

java-static Interpolator!
getInterpolator(interpolator: Int, interpolatorString: String!)

get the interpolater based on a constant or a string

Int
getKeyFrames(
    id: String!,
    rectangles: FloatArray!,
    pathMode: IntArray!,
    position: IntArray!
)
Motion!
Int
FloatArray<Float>!
WidgetFrame!

Used in debug draw

WidgetFrame!
Float
getTouchUpProgress(currentTime: Long)

get the current touch up progress current time in nanoseconds (ideally coming from an animation clock)

Transition.WidgetState!
getWidgetState(
    widgetId: String!,
    child: ConstraintWidget!,
    transitionState: Int
)
Boolean
Boolean
Unit
interpolate(parentWidth: Int, parentHeight: Int, progress: Float)
Boolean
Boolean
isTouchNotDone(currentProgress: Float)

Are we still animating

Unit
setTouchUp(
    currentProgress: Float,
    currentTime: Long,
    velocityX: Float,
    velocityY: Float
)

Set the start of the touch up

Unit
Boolean
setValue(id: Int, value: Boolean)

Used to set boolean values

Boolean
setValue(id: Int, value: Float)

Used to set float values

Boolean
setValue(id: Int, value: Int)

Used to set integer values

Boolean
setValue(id: Int, value: String!)

Used to set String values

Unit
updateFrom(container: ConstraintWidgetContainer!, state: Int)

Update container of parameters for the state

Inherited Constants

From androidx.constraintlayout.core.motion.utils.TypedValues
const Int
const Int
const Int
const Int
const String!
S_CUSTOM = "CUSTOM"
const Int
const Int

Constants

END

Added in 1.1.0-alpha13
const val END = 1: Int

INTERPOLATED

Added in 1.1.0-alpha13
const val INTERPOLATED = 2: Int

START

Added in 1.1.0-alpha13
const val START = 0: Int

Public constructors

Transition

Added in 1.1.0-alpha13
Transition(dpToPixel: CorePixelDp)

Public functions

addCustomColor

Added in 1.1.0-alpha13
fun addCustomColor(state: Int, widgetId: String!, property: String!, color: Int): Unit

addCustomFloat

Added in 1.1.0-alpha13
fun addCustomFloat(state: Int, widgetId: String!, property: String!, value: Float): Unit

addKeyAttribute

Added in 1.1.0-alpha13
fun addKeyAttribute(target: String!, bundle: TypedBundle!): Unit

addKeyAttribute

Added in 1.1.0-alpha13
fun addKeyAttribute(
    target: String!,
    bundle: TypedBundle!,
    custom: Array<CustomVariable!>!
): Unit

Add a key attribute and the custom variables into the

Parameters
target: String!

the id of the target

bundle: TypedBundle!

the key attributes bundle containing position etc.

custom: Array<CustomVariable!>!

the customVariables to add at that position

addKeyCycle

Added in 1.1.0-alpha13
fun addKeyCycle(target: String!, bundle: TypedBundle!): Unit

addKeyPosition

Added in 1.1.0-alpha13
fun addKeyPosition(target: String!, bundle: TypedBundle!): Unit

addKeyPosition

Added in 1.1.0-alpha13
fun addKeyPosition(target: String!, frame: Int, type: Int, x: Float, y: Float): Unit

calcStagger

Added in 1.1.0-alpha13
fun calcStagger(): Unit

clear

Added in 1.1.0-alpha13
fun clear(): Unit

contains

Added in 1.1.0-alpha13
fun contains(key: String!): Boolean

dragToProgress

Added in 1.1.0-alpha13
fun dragToProgress(
    currentProgress: Float,
    baseW: Int,
    baseH: Int,
    dx: Float,
    dy: Float
): Float

Converts from xy drag to progress This should be used till touch up

Parameters
baseW: Int

parent width

baseH: Int

parent height

dx: Float

change in x

dy: Float

change in y

Returns
Float

the change in progress

fillKeyPositions

Added in 1.1.0-alpha13
fun fillKeyPositions(
    frame: WidgetFrame!,
    x: FloatArray!,
    y: FloatArray!,
    pos: FloatArray!
): Unit

findNextPosition

Added in 1.1.0-alpha13
fun findNextPosition(target: String!, frameNumber: Int): Transition.KeyPosition!

findPreviousPosition

Added in 1.1.0-alpha13
fun findPreviousPosition(target: String!, frameNumber: Int): Transition.KeyPosition!

getAutoTransition

Added in 1.1.0-alpha13
fun getAutoTransition(): Int

This gets the auto transition mode being used

getEnd

Added in 1.1.0-alpha13
fun getEnd(child: ConstraintWidget!): WidgetFrame!

Used in debug draw

getEnd

Added in 1.1.0-alpha13
fun getEnd(id: String!): WidgetFrame!

getId

Added in 1.1.0-alpha13
fun getId(name: String!): Int

getInterpolated

Added in 1.1.0-alpha13
fun getInterpolated(child: ConstraintWidget!): WidgetFrame!

Used after the interpolation

getInterpolated

Added in 1.1.0-alpha13
fun getInterpolated(id: String!): WidgetFrame!

getInterpolatedHeight

Added in 1.1.0-alpha13
fun getInterpolatedHeight(): Int

getInterpolatedWidth

Added in 1.1.0-alpha13
fun getInterpolatedWidth(): Int

getInterpolator

Added in 1.1.0-alpha13
fun getInterpolator(): Interpolator!

This gets the interpolator being used

getInterpolator

Added in 1.1.0-alpha13
java-static fun getInterpolator(interpolator: Int, interpolatorString: String!): Interpolator!

get the interpolater based on a constant or a string

getKeyFrames

Added in 1.1.0-alpha13
fun getKeyFrames(
    id: String!,
    rectangles: FloatArray!,
    pathMode: IntArray!,
    position: IntArray!
): Int

getMotion

Added in 1.1.0-alpha13
fun getMotion(id: String!): Motion!

getNumberKeyPositions

Added in 1.1.0-alpha13
fun getNumberKeyPositions(frame: WidgetFrame!): Int

getPath

Added in 1.1.0-alpha13
fun getPath(id: String!): FloatArray<Float>!

getStart

Added in 1.1.0-alpha13
fun getStart(child: ConstraintWidget!): WidgetFrame!

Used in debug draw

getStart

Added in 1.1.0-alpha13
fun getStart(id: String!): WidgetFrame!

getTouchUpProgress

Added in 1.1.0-alpha13
fun getTouchUpProgress(currentTime: Long): Float

get the current touch up progress current time in nanoseconds (ideally coming from an animation clock)

Parameters
currentTime: Long

in nanoseconds

Returns
Float

progress

getWidgetState

Added in 1.1.0-alpha13
fun getWidgetState(
    widgetId: String!,
    child: ConstraintWidget!,
    transitionState: Int
): Transition.WidgetState!

hasOnSwipe

Added in 1.1.0-alpha13
fun hasOnSwipe(): Boolean

hasPositionKeyframes

Added in 1.1.0-alpha13
fun hasPositionKeyframes(): Boolean

interpolate

Added in 1.1.0-alpha13
fun interpolate(parentWidth: Int, parentHeight: Int, progress: Float): Unit

isEmpty

Added in 1.1.0-alpha13
fun isEmpty(): Boolean

isTouchNotDone

Added in 1.1.0-alpha13
fun isTouchNotDone(currentProgress: Float): Boolean

Are we still animating

Parameters
currentProgress: Float

motion progress

Returns
Boolean

true to continue moving

setTouchUp

Added in 1.1.0-alpha13
fun setTouchUp(
    currentProgress: Float,
    currentTime: Long,
    velocityX: Float,
    velocityY: Float
): Unit

Set the start of the touch up

Parameters
currentProgress: Float

0...1 progress in

currentTime: Long

time in nanoseconds

velocityX: Float

pixels per millisecond

velocityY: Float

pixels per millisecond

setTransitionProperties

Added in 1.1.0-alpha13
fun setTransitionProperties(bundle: TypedBundle!): Unit

setValue

Added in 1.1.0-alpha13
fun setValue(id: Int, value: Boolean): Boolean

Used to set boolean values

Returns
Boolean

true if it accepted the value

setValue

Added in 1.1.0-alpha13
fun setValue(id: Int, value: Float): Boolean

Used to set float values

Returns
Boolean

true if it accepted the value

setValue

Added in 1.1.0-alpha13
fun setValue(id: Int, value: Int): Boolean

Used to set integer values

Returns
Boolean

true if it accepted the value

setValue

Added in 1.1.0-alpha13
fun setValue(id: Int, value: String!): Boolean

Used to set String values

Returns
Boolean

true if it accepted the value

updateFrom

Added in 1.1.0-alpha13
fun updateFrom(container: ConstraintWidgetContainer!, state: Int): Unit

Update container of parameters for the state

Parameters
container: ConstraintWidgetContainer!

contains all the widget parameters

state: Int

starting or ending