MotionScene.Transition

public class MotionScene.Transition


Transition defines the interaction from one state to another. With out a Transition object Transition between two stats involves strictly linear interpolation

Summary

Nested types

Constants

static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int

Public constructors

Transition(
    int id,
    MotionScene motionScene,
    int constraintSetStartId,
    int constraintSetEndId
)

Create a transition

Public methods

void

add a keyframe to this motion scene

void
addOnClick(Context context, XmlPullParser parser)

Add on Click support using the xml parser

void
addOnClick(int id, int action)

Add the onclick to this view

String

Print a debug string indicating the starting and ending state of the transition

int

return the autoTransitionType. one of AUTO_NONE, AUTO_JUMP_TO_START, AUTO_JUMP_TO_END, AUTO_ANIMATE_TO_START, AUTO_ANIMATE_TO_END

int

gets the default transition duration

int

Get the id of the constraint set to go to

int

Transitions can be given and ID.

List<KeyFrames>
int

get the mode of layout during transition

List<MotionScene.Transition.TransitionOnClick>

Get the onClick handlers.

int

gets the pathMotionArc for the all motions in this transition. if set to UNSET (default) it reverts to the setting of the constraintSet

float

Gets the stagger value.

int

Gets the id of the starting constraint set

TouchResponse

Get the Touch response manager

boolean

Returns true if this Transition can be auto considered for transition Default is enabled

boolean
isTransitionFlag(int flag)

is the transition flag set

void
removeOnClick(int id)

Remove the onclick added to this view

void

sets the autoTransitionType On reaching a state auto transitions may be run based on one of AUTO_NONE, AUTO_JUMP_TO_START, AUTO_JUMP_TO_END, AUTO_ANIMATE_TO_START, AUTO_ANIMATE_TO_END

void
setDuration(int duration)

sets the duration of the transition if set to <8 it will be set to 8

void
setEnabled(boolean enable)

enable or disable the Transition.

void
setInterpolatorInfo(
    int interpolator,
    String interpolatorString,
    int interpolatorID
)

Sets the interpolation used for this transition.

void

set the mode of layout during transition

void

Set the onSwipe for this Transition

void
setOnTouchUp(int touchUpMode)

Set the on touch up mode

void
setPathMotionArc(int arcMode)

Sets the pathMotionArc for the all motions in this transition. if set to UNSET (default) it reverts to the setting of the constraintSet

void
setStagger(float stagger)

Sets the stagger value.

void

Constants

AUTO_ANIMATE_TO_END

Added in 2.2.0-alpha13
public static final int AUTO_ANIMATE_TO_END = 4

AUTO_ANIMATE_TO_START

Added in 2.2.0-alpha13
public static final int AUTO_ANIMATE_TO_START = 3

AUTO_JUMP_TO_END

Added in 2.2.0-alpha13
public static final int AUTO_JUMP_TO_END = 2

AUTO_JUMP_TO_START

Added in 2.2.0-alpha13
public static final int AUTO_JUMP_TO_START = 1

AUTO_NONE

Added in 2.2.0-alpha13
public static final int AUTO_NONE = 0

INTERPOLATE_ANTICIPATE

Added in 2.2.0-alpha13
public static final int INTERPOLATE_ANTICIPATE = 6

INTERPOLATE_BOUNCE

Added in 2.2.0-alpha13
public static final int INTERPOLATE_BOUNCE = 4

INTERPOLATE_EASE_IN

Added in 2.2.0-alpha13
public static final int INTERPOLATE_EASE_IN = 1

INTERPOLATE_EASE_IN_OUT

Added in 2.2.0-alpha13
public static final int INTERPOLATE_EASE_IN_OUT = 0

INTERPOLATE_EASE_OUT

Added in 2.2.0-alpha13
public static final int INTERPOLATE_EASE_OUT = 2

INTERPOLATE_LINEAR

Added in 2.2.0-alpha13
public static final int INTERPOLATE_LINEAR = 3

INTERPOLATE_OVERSHOOT

Added in 2.2.0-alpha13
public static final int INTERPOLATE_OVERSHOOT = 5

INTERPOLATE_REFERENCE_ID

Added in 2.2.0-alpha13
public static final int INTERPOLATE_REFERENCE_ID = -2

INTERPOLATE_SPLINE_STRING

Added in 2.2.0-alpha13
public static final int INTERPOLATE_SPLINE_STRING = -1

Public constructors

Transition

Added in 2.2.0-alpha13
public Transition(
    int id,
    MotionScene motionScene,
    int constraintSetStartId,
    int constraintSetEndId
)

Create a transition

Parameters
int id

a unique id to represent the transition.

MotionScene motionScene

the motion scene that the transition will be added to.

int constraintSetStartId

id of the ConstraintSet to be used for the start of transition

int constraintSetEndId

id of the ConstraintSet to be used for the end of transition

Public methods

addKeyFrame

Added in 2.2.0-alpha13
public void addKeyFrame(KeyFrames keyFrames)

add a keyframe to this motion scene

Parameters
KeyFrames keyFrames

addOnClick

Added in 2.2.0-alpha13
public void addOnClick(Context context, XmlPullParser parser)

Add on Click support using the xml parser

Parameters
Context context
XmlPullParser parser

addOnClick

Added in 2.2.0-alpha13
public void addOnClick(int id, int action)

Add the onclick to this view

Parameters
int id
int action

debugString

Added in 2.2.0-alpha13
public String debugString(Context context)

Print a debug string indicating the starting and ending state of the transition

Parameters
Context context
Returns
String

getAutoTransition

Added in 2.2.0-alpha13
public int getAutoTransition()

return the autoTransitionType. one of AUTO_NONE, AUTO_JUMP_TO_START, AUTO_JUMP_TO_END, AUTO_ANIMATE_TO_START, AUTO_ANIMATE_TO_END

Returns
int

0=NONE, 1=JUMP_TO_START, 2=JUMP_TO_END, 3=ANIMATE_TO_START, 4=ANIMATE_TO_END

getDuration

Added in 2.2.0-alpha13
public int getDuration()

gets the default transition duration

Returns
int

duration int milliseconds

getEndConstraintSetId

Added in 2.2.0-alpha13
public int getEndConstraintSetId()

Get the id of the constraint set to go to

Returns
int

getId

Added in 2.2.0-alpha13
public int getId()

Transitions can be given and ID. If unset it returns UNSET (-1)

Returns
int

The Id of the Transition set in the MotionScene File or UNSET (-1)

getKeyFrameList

Added in 2.2.0-alpha13
public List<KeyFramesgetKeyFrameList()

getLayoutDuringTransition

Added in 2.2.0-alpha13
public int getLayoutDuringTransition()

get the mode of layout during transition

Returns
int

getOnClickList

Added in 2.2.0-alpha13
public List<MotionScene.Transition.TransitionOnClickgetOnClickList()

Get the onClick handlers.

Returns
List<MotionScene.Transition.TransitionOnClick>

list of on click handler

getPathMotionArc

Added in 2.2.0-alpha13
public int getPathMotionArc()

gets the pathMotionArc for the all motions in this transition. if set to UNSET (default) it reverts to the setting of the constraintSet

Returns
int

arcMode

getStagger

Added in 2.2.0-alpha13
public float getStagger()

Gets the stagger value.

Returns
float

getStartConstraintSetId

Added in 2.2.0-alpha13
public int getStartConstraintSetId()

Gets the id of the starting constraint set

Returns
int

getTouchResponse

Added in 2.2.0-alpha13
public TouchResponse getTouchResponse()

Get the Touch response manager

Returns
TouchResponse

isEnabled

Added in 2.2.0-alpha13
public boolean isEnabled()

Returns true if this Transition can be auto considered for transition Default is enabled

isTransitionFlag

Added in 2.2.0-alpha13
public boolean isTransitionFlag(int flag)

is the transition flag set

Parameters
int flag
Returns
boolean

removeOnClick

Added in 2.2.0-alpha13
public void removeOnClick(int id)

Remove the onclick added to this view

Parameters
int id

setAutoTransition

Added in 2.2.0-alpha13
public void setAutoTransition(int type)

sets the autoTransitionType On reaching a state auto transitions may be run based on one of AUTO_NONE, AUTO_JUMP_TO_START, AUTO_JUMP_TO_END, AUTO_ANIMATE_TO_START, AUTO_ANIMATE_TO_END

Parameters
int type

setDuration

Added in 2.2.0-alpha13
public void setDuration(int duration)

sets the duration of the transition if set to <8 it will be set to 8

Parameters
int duration

in milliseconds (min is 8)

setEnabled

Added in 2.2.0-alpha13
public void setEnabled(boolean enable)

enable or disable the Transition. If a Transition is disabled it is not eligible for automatically switching to.

Parameters
boolean enable

setInterpolatorInfo

Added in 2.2.0-alpha13
public void setInterpolatorInfo(
    int interpolator,
    String interpolatorString,
    int interpolatorID
)

Sets the interpolation used for this transition. The call support standard types EASE_IN_OUT etc.: setInterpolatorInfo(MotionScene.Transition.INTERPOLATE_EASE_IN_OUT, null, 0); setInterpolatorInfo(MotionScene.Transition.INTERPOLATE_OVERSHOOT, null, 0); Strings such as "cubic(...)" , "spline(...)" setInterpolatorInfo( MotionScene.Transition.INTERPOLATE_SPLINE_STRING, "cubic(1,0,0,1)", 0); Android interpolators in res/anim : setInterpolatorInfo( MotionScene.Transition.INTERPOLATE_REFERENCE_ID, null, R.anim....);

Parameters
int interpolator

sets the type of interpolation (MotionScene.Transition.INTERPOLATE_*)

String interpolatorString

sets a string based custom interpolation

int interpolatorID

sets the id of a Android Transition

setLayoutDuringTransition

Added in 2.2.0-alpha13
public void setLayoutDuringTransition(int mode)

set the mode of layout during transition

Parameters
int mode

setOnSwipe

Added in 2.2.0-alpha13
public void setOnSwipe(OnSwipe onSwipe)

Set the onSwipe for this Transition

Parameters
OnSwipe onSwipe

setOnTouchUp

Added in 2.2.0-alpha13
public void setOnTouchUp(int touchUpMode)

Set the on touch up mode

Parameters
int touchUpMode

setPathMotionArc

Added in 2.2.0-alpha13
public void setPathMotionArc(int arcMode)

Sets the pathMotionArc for the all motions in this transition. if set to UNSET (default) it reverts to the setting of the constraintSet

Parameters
int arcMode

setStagger

Added in 2.2.0-alpha13
public void setStagger(float stagger)

Sets the stagger value. A Stagger value of zero means no stagger. A Stagger value of 1 means the last view starts moving at .5 progress

Parameters
float stagger

setTransitionFlag

Added in 2.2.0-alpha13
public void setTransitionFlag(int flag)