public class KeyTrigger extends Key


Defines container for a key frame of for storing KeyAttributes. KeyAttributes change post layout values of a view.

Summary

Constants

static final String
CROSS = "CROSS"
static final int
static final String
NEGATIVE_CROSS = "negativeCross"
static final String
POSITIVE_CROSS = "positiveCross"
static final String
POST_LAYOUT = "postLayout"
static final String
TRIGGER_COLLISION_ID = "triggerCollisionId"
static final String
TRIGGER_COLLISION_VIEW = "triggerCollisionView"
static final String
TRIGGER_ID = "triggerID"
static final String
TRIGGER_RECEIVER = "triggerReceiver"
static final String
TRIGGER_SLACK = "triggerSlack"
static final String
VIEW_TRANSITION_ON_CROSS = "viewTransitionOnCross"
static final String
VIEW_TRANSITION_ON_NEGATIVE_CROSS = "viewTransitionOnNegativeCross"
static final String
VIEW_TRANSITION_ON_POSITIVE_CROSS = "viewTransitionOnPositiveCross"

Public constructors

Public methods

void

Defines method to add a a view to splines derived form this key frame.

Key

Clone this KeyAttributes

void
conditionallyFire(float pos, View child)

This fires the keyTriggers associated with this view at that position

Key
copy(Key src)

Copy the key

void
void
load(Context context, AttributeSet attrs)
void
setValue(String tag, Object value)

Set the value associated with this tag

Inherited Constants

From androidx.constraintlayout.motion.widget.Key
static final String
ALPHA = "alpha"
static final String
CURVEFIT = "curveFit"
static final String
CUSTOM = "CUSTOM"
static final String
ELEVATION = "elevation"
static final String
MOTIONPROGRESS = "motionProgress"
static final String
PIVOT_X = "transformPivotX"
static final String
PIVOT_Y = "transformPivotY"
static final String
PROGRESS = "progress"
static final String
ROTATION = "rotation"
static final String
ROTATION_X = "rotationX"
static final String
ROTATION_Y = "rotationY"
static final String
SCALE_X = "scaleX"
static final String
SCALE_Y = "scaleY"
static final String
TRANSITIONEASING = "transitionEasing"
static final String
TRANSITION_PATH_ROTATE = "transitionPathRotate"
static final String
TRANSLATION_X = "translationX"
static final String
TRANSLATION_Y = "translationY"
static final String
TRANSLATION_Z = "translationZ"
static final String
VISIBILITY = "visibility"
static final String
WAVE_OFFSET = "waveOffset"
static final String
WAVE_PERIOD = "wavePeriod"
static final String
WAVE_PHASE = "wavePhase"
static final String
WAVE_VARIES_BY = "waveVariesBy"

Inherited fields

From androidx.constraintlayout.motion.widget.Key
static int
int

Inherited methods

From androidx.constraintlayout.motion.widget.Key
int

Gets the current frame position

void

sets the frame position

void

Key frame can specify the type of interpolation it wants on various attributes For each string it set it to -1, CurveFit.LINEAR or CurveFit.SPLINE

Key
setViewId(int id)

set the id of the view

Constants

CROSS

Added in 2.2.0-alpha13
public static final String CROSS = "CROSS"

KEY_TYPE

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

NEGATIVE_CROSS

Added in 2.2.0-alpha13
public static final String NEGATIVE_CROSS = "negativeCross"

POSITIVE_CROSS

Added in 2.2.0-alpha13
public static final String POSITIVE_CROSS = "positiveCross"

POST_LAYOUT

Added in 2.2.0-alpha13
public static final String POST_LAYOUT = "postLayout"

TRIGGER_COLLISION_ID

Added in 2.2.0-alpha13
public static final String TRIGGER_COLLISION_ID = "triggerCollisionId"

TRIGGER_COLLISION_VIEW

Added in 2.2.0-alpha13
public static final String TRIGGER_COLLISION_VIEW = "triggerCollisionView"

TRIGGER_ID

Added in 2.2.0-alpha13
public static final String TRIGGER_ID = "triggerID"

TRIGGER_RECEIVER

Added in 2.2.0-alpha13
public static final String TRIGGER_RECEIVER = "triggerReceiver"

TRIGGER_SLACK

Added in 2.2.0-alpha13
public static final String TRIGGER_SLACK = "triggerSlack"

VIEW_TRANSITION_ON_CROSS

Added in 2.2.0-alpha13
public static final String VIEW_TRANSITION_ON_CROSS = "viewTransitionOnCross"

VIEW_TRANSITION_ON_NEGATIVE_CROSS

Added in 2.2.0-alpha13
public static final String VIEW_TRANSITION_ON_NEGATIVE_CROSS = "viewTransitionOnNegativeCross"

VIEW_TRANSITION_ON_POSITIVE_CROSS

Added in 2.2.0-alpha13
public static final String VIEW_TRANSITION_ON_POSITIVE_CROSS = "viewTransitionOnPositiveCross"

Public constructors

KeyTrigger

Added in 2.2.0-alpha13
public KeyTrigger()

Public methods

addValues

Added in 2.2.0-alpha13
public void addValues(HashMap<StringViewSpline> splines)

Defines method to add a a view to splines derived form this key frame. The values are written to the spline

Parameters
HashMap<StringViewSpline> splines

splines to write values to

clone

Added in 2.2.0-alpha13
public Key clone()

Clone this KeyAttributes

Returns
Key

conditionallyFire

Added in 2.2.0-alpha13
public void conditionallyFire(float pos, View child)

This fires the keyTriggers associated with this view at that position

Parameters
float pos

the progress

View child

the view

copy

public Key copy(Key src)

Copy the key

Parameters
Key src

to be copied

Returns
Key

self

getAttributeNames

Added in 2.2.0-alpha13
public void getAttributeNames(HashSet<String> attributes)

load

Added in 2.2.0-alpha13
public void load(Context context, AttributeSet attrs)

setValue

Added in 2.2.0-alpha13
public void setValue(String tag, Object value)

Set the value associated with this tag

Parameters
String tag
Object value