BoundsRule.ValueRule

public final class BoundsRule.ValueRule


This class represents individual rules for updating the bounds.

Summary

Public methods

static @NonNull BoundsRule.ValueRule
absoluteValue(int absoluteValue)

Creates ValueRule using an absolute value.

int
float
static @NonNull BoundsRule.ValueRule
inheritFromParent(float fraction)

Creates ValueRule using a fraction of parent size.

static @NonNull BoundsRule.ValueRule
inheritFromParentWithOffset(float fraction, int value)

Creates ValueRule of fraction and offset.

void
setAbsoluteValue(int absoluteValue)

Sets the absolute/offset value for rule.

void
setFraction(float fraction)

Sets the fractional value (percentage of parent) for this rule.

Public methods

absoluteValue

Added in 1.1.0
public static @NonNull BoundsRule.ValueRule absoluteValue(int absoluteValue)

Creates ValueRule using an absolute value.

Parameters
int absoluteValue

Absolute value.

Returns
@NonNull BoundsRule.ValueRule

Newly created ValueRule.

getAbsoluteValue

Added in 1.1.0
public int getAbsoluteValue()
Returns
int

The current absolute/offset value forrule.

getFraction

Added in 1.1.0
public float getFraction()
Returns
float

The current fractional value.

inheritFromParent

Added in 1.1.0
public static @NonNull BoundsRule.ValueRule inheritFromParent(float fraction)

Creates ValueRule using a fraction of parent size.

Parameters
float fraction

Percentage of parent.

Returns
@NonNull BoundsRule.ValueRule

Newly created ValueRule.

inheritFromParentWithOffset

Added in 1.1.0
public static @NonNull BoundsRule.ValueRule inheritFromParentWithOffset(float fraction, int value)

Creates ValueRule of fraction and offset.

Parameters
float fraction

Percentage of parent.

int value

Offset

Returns
@NonNull BoundsRule.ValueRule

Newly created ValueRule.

setAbsoluteValue

Added in 1.1.0
public void setAbsoluteValue(int absoluteValue)

Sets the absolute/offset value for rule.

Parameters
int absoluteValue

Absolute value.

setFraction

Added in 1.1.0
public void setFraction(float fraction)

Sets the fractional value (percentage of parent) for this rule.

Parameters
float fraction

Percentage of parent.