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
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
public int getAbsoluteValue()
| Returns | |
|---|---|
int |
The current absolute/offset value forrule. |
inheritFromParent
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
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
public void setAbsoluteValue(int absoluteValue)
Sets the absolute/offset value for rule.
| Parameters | |
|---|---|
int absoluteValue |
Absolute value. |
setFraction
public void setFraction(float fraction)
Sets the fractional value (percentage of parent) for this rule.
| Parameters | |
|---|---|
float fraction |
Percentage of parent. |