public class ChainReference extends HelperReference


HelperReference for Chains. Elements should be added with addChainElement

Summary

Protected fields

float
@NonNull HashMap<StringFloat>

This field is deprecated.

Unintended visibility, use getPostMargin instead

@NonNull HashMap<StringFloat>

This field is deprecated.

Unintended visibility, use getPreMargin instead

@NonNull HashMap<StringFloat>

This field is deprecated.

Unintended visibility, use getWeight instead

@NonNull State.Chain

Public constructors

Public methods

void
addChainElement(
    @NonNull String id,
    float weight,
    float preMargin,
    float postMargin
)

Adds the element by the given id to the Chain.

@NonNull ChainReference
bias(float bias)
float
@NonNull State.Chain
@NonNull ChainReference

Sets the style.

Protected methods

float
float
float

Inherited methods

From androidx.constraintlayout.core.state.ConstraintReference
void
addCustomColor(String name, int color)
void
addCustomFloat(String name, float value)
ConstraintReference
alpha(float alpha)
void

apply all the constraints attributes of the mConstraintWidget

ConstraintReference
ConstraintReference
ConstraintReference
ConstraintReference
baselineToTop(Object reference)
ConstraintReference
ConstraintReference
ConstraintReference
bottomToTop(Object reference)
ConstraintReference
ConstraintReference
ConstraintReference
circularConstraint(Object reference, float angle, float distance)
ConstraintReference
ConstraintReference

Clears all constraints.

ConstraintReference
ConstraintReference
ConstraintWidget
ConstraintReference
end()
ConstraintReference
endToEnd(Object reference)
ConstraintReference
endToStart(Object reference)
float
Facade
Dimension
int
float
Object
float
float
float
float
float
float
float
String
float
float
float
int
getVerticalChainStyle(int chainStyle)
float
Object
Dimension
ConstraintReference
height(Dimension dimension)
ConstraintReference
horizontalBias(float value)
ConstraintReference
ConstraintReference
leftToLeft(Object reference)
ConstraintReference
leftToRight(Object reference)
ConstraintReference
margin(Object marginValue)
ConstraintReference
margin(int value)
ConstraintReference
marginGone(Object marginGoneValue)
ConstraintReference
marginGone(int value)
ConstraintReference
pivotX(float x)
ConstraintReference
pivotY(float y)
ConstraintReference
ConstraintReference
rightToLeft(Object reference)
ConstraintReference
rightToRight(Object reference)
ConstraintReference
rotationX(float x)
ConstraintReference
rotationY(float y)
ConstraintReference
rotationZ(float z)
ConstraintReference
scaleX(float x)
ConstraintReference
scaleY(float y)
void
void
setFacade(Facade facade)
ConstraintReference
setHeight(Dimension dimension)
void
setHorizontalChainStyle(int chainStyle)
void
void
void
void
setVerticalChainStyle(int chainStyle)
void
setVerticalChainWeight(float weight)
void
ConstraintReference
setWidth(Dimension dimension)
ConstraintReference
ConstraintReference
startToEnd(Object reference)
ConstraintReference
startToStart(Object reference)
ConstraintReference
top()
ConstraintReference
topToBottom(Object reference)
ConstraintReference
topToTop(Object reference)
ConstraintReference
translationX(float x)
ConstraintReference
translationY(float y)
ConstraintReference
translationZ(float z)
void

Validate the constraints

ConstraintReference
verticalBias(float value)
ConstraintReference
visibility(int visibility)
ConstraintReference
width(Dimension dimension)
From androidx.constraintlayout.core.state.HelperReference
HelperReference
add(Object[] objects)
void
void

Allows the derived classes to invoke the apply method in the ConstraintReference

ConstraintWidget
HelperWidget
State.Helper
void

Protected fields

mBias

Added in 1.1.0-alpha13
protected float mBias

mMapPostMargin

Added in 1.1.0-alpha13
Deprecated in 1.1.0-alpha13
protected @NonNull HashMap<StringFloatmMapPostMargin

mMapPreMargin

Added in 1.1.0-alpha13
Deprecated in 1.1.0-alpha13
protected @NonNull HashMap<StringFloatmMapPreMargin

mMapWeights

Added in 1.1.0-alpha13
Deprecated in 1.1.0-alpha13
protected @NonNull HashMap<StringFloatmMapWeights

mStyle

Added in 1.1.0-alpha13
protected @NonNull State.Chain mStyle

Public constructors

ChainReference

Added in 1.1.0-alpha13
public ChainReference(@NonNull State state, @NonNull State.Helper type)

Public methods

addChainElement

Added in 1.1.0-alpha13
public void addChainElement(
    @NonNull String id,
    float weight,
    float preMargin,
    float postMargin
)

Adds the element by the given id to the Chain. The order in which the elements are added is important. It will represent the element's position in the Chain.

Parameters
@NonNull String id

Id of the element to add

float weight

Weight used to distribute remaining space to each element

float preMargin

Additional space in pixels between the added element and the previous one (if any)

float postMargin

Additional space in pixels between the added element and the next one (if any)

bias

Added in 1.1.0-alpha13
public @NonNull ChainReference bias(float bias)

getBias

Added in 1.1.0-alpha13
public float getBias()

getStyle

Added in 1.1.0-alpha13
public @NonNull State.Chain getStyle()

style

Added in 1.1.0-alpha13
public @NonNull ChainReference style(@NonNull State.Chain style)

Sets the style.

Parameters
@NonNull State.Chain style

Defines the way the chain will lay out its elements

Returns
@NonNull ChainReference

This same instance

Protected methods

getPostMargin

Added in 1.1.0-alpha13
protected float getPostMargin(@NonNull String id)

getPreMargin

Added in 1.1.0-alpha13
protected float getPreMargin(@NonNull String id)

getWeight

Added in 1.1.0-alpha13
protected float getWeight(@NonNull String id)