public class StateSet


Summary

Constants

static final String
TAG = "ConstraintLayoutStates"

Public constructors

StateSet(Context context, XmlPullParser parser)

Parse a StateSet

Public methods

int
convertToConstraintSet(
    int currentConstrainSettId,
    int stateId,
    float width,
    float height
)

converts a state to a constraintSet

boolean
needsToChange(int id, float width, float height)

will the layout need to change

void
setOnConstraintsChanged(
    ConstraintsChangedListener constraintsChangedListener
)

listen for changes in constraintSet

int
stateGetConstraintID(int id, int width, int height)

Get the constraint id for a state

int
updateConstraints(int currentId, int id, float width, float height)

Update the Constraints

Constants

TAG

Added in 2.2.0
public static final String TAG = "ConstraintLayoutStates"

Public constructors

StateSet

Added in 2.2.0
public StateSet(Context context, XmlPullParser parser)

Parse a StateSet

Parameters
Context context
XmlPullParser parser

Public methods

convertToConstraintSet

Added in 2.2.0
public int convertToConstraintSet(
    int currentConstrainSettId,
    int stateId,
    float width,
    float height
)

converts a state to a constraintSet

Parameters
int currentConstrainSettId
int stateId
float width
float height
Returns
int

needsToChange

Added in 2.2.0
public boolean needsToChange(int id, float width, float height)

will the layout need to change

Parameters
int id
float width
float height
Returns
boolean

setOnConstraintsChanged

Added in 2.2.0
public void setOnConstraintsChanged(
    ConstraintsChangedListener constraintsChangedListener
)

listen for changes in constraintSet

Parameters
ConstraintsChangedListener constraintsChangedListener

stateGetConstraintID

Added in 2.2.0
public int stateGetConstraintID(int id, int width, int height)

Get the constraint id for a state

Parameters
int id
int width
int height
Returns
int

updateConstraints

Added in 2.2.0
public int updateConstraints(int currentId, int id, float width, float height)

Update the Constraints

Parameters
int currentId
int id
float width
float height
Returns
int