public class KeyPosition extends Key


Provide the passive data structure to get KeyPosition information form XML

Summary

Constants

static final String
DRAWPATH = "drawPath"
static final String
PERCENT_HEIGHT = "percentHeight"
static final String
PERCENT_WIDTH = "percentWidth"
static final String
PERCENT_X = "percentX"
static final String
PERCENT_Y = "percentY"
static final float
static final String
SIZE_PERCENT = "sizePercent"
static final String
TRANSITION_EASING = "transitionEasing"
static final int
static final int
static final int
static final int

Public constructors

Public methods

void

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

Key

Clone this KeyAttributes

Key
copy(Key src)

Copy the key

boolean
intersects(
    int layoutWidth,
    int layoutHeight,
    RectF start,
    RectF end,
    float x,
    float y
)
void
load(Context context, AttributeSet attrs)
void
positionAttributes(
    View view,
    RectF start,
    RectF end,
    float x,
    float y,
    String[] attribute,
    float[] value
)
void
setType(int type)
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

DRAWPATH

Added in 2.2.0-alpha13
public static final String DRAWPATH = "drawPath"

PERCENT_HEIGHT

Added in 2.2.0-alpha13
public static final String PERCENT_HEIGHT = "percentHeight"

PERCENT_WIDTH

Added in 2.2.0-alpha13
public static final String PERCENT_WIDTH = "percentWidth"

PERCENT_X

Added in 2.2.0-alpha13
public static final String PERCENT_X = "percentX"

PERCENT_Y

Added in 2.2.0-alpha13
public static final String PERCENT_Y = "percentY"

SELECTION_SLOPE

protected static final float SELECTION_SLOPE = 20.0f

SIZE_PERCENT

Added in 2.2.0-alpha13
public static final String SIZE_PERCENT = "sizePercent"

TRANSITION_EASING

Added in 2.2.0-alpha13
public static final String TRANSITION_EASING = "transitionEasing"

TYPE_AXIS

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

TYPE_CARTESIAN

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

TYPE_PATH

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

TYPE_SCREEN

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

Public constructors

KeyPosition

Added in 2.2.0-alpha13
public KeyPosition()

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

copy

public Key copy(Key src)

Copy the key

Parameters
Key src

to be copied

Returns
Key

self

intersects

Added in 2.2.0-alpha13
public boolean intersects(
    int layoutWidth,
    int layoutHeight,
    RectF start,
    RectF end,
    float x,
    float y
)
Parameters
int layoutWidth
int layoutHeight
RectF start
RectF end
float x
float y
Returns
boolean

load

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

positionAttributes

Added in 2.2.0-alpha13
public void positionAttributes(
    View view,
    RectF start,
    RectF end,
    float x,
    float y,
    String[] attribute,
    float[] value
)
Parameters
View view
RectF start
RectF end
float x
float y
String[] attribute
float[] value

setType

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

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