added in version 1.0.0
belongs to Maven artifact androidx.leanback:leanback:1.0.0

BoundsRule.ValueRule

public static final class BoundsRule.ValueRule
extends Object

java.lang.Object
   ↳ androidx.leanback.graphics.BoundsRule.ValueRule


This class represents individual rules for updating the bounds.

Summary

Public methods

static BoundsRule.ValueRule absoluteValue(int absoluteValue)

Creates ValueRule using an absolute value.

int getAbsoluteValue()
float getFraction()
static BoundsRule.ValueRule inheritFromParent(float fraction)

Creates ValueRule using a fraction of parent size.

static 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.

Inherited methods

Public methods

absoluteValue

added in version 1.0.0
public static BoundsRule.ValueRule absoluteValue (int absoluteValue)

Creates ValueRule using an absolute value.

Parameters
absoluteValue int: Absolute value.

Returns
BoundsRule.ValueRule Newly created ValueRule.

getAbsoluteValue

added in version 1.0.0
public int getAbsoluteValue ()

Returns
int The current absolute/offset value forrule.

getFraction

added in version 1.0.0
public float getFraction ()

Returns
float The current fractional value.

inheritFromParent

added in version 1.0.0
public static BoundsRule.ValueRule inheritFromParent (float fraction)

Creates ValueRule using a fraction of parent size.

Parameters
fraction float: Percentage of parent.

Returns
BoundsRule.ValueRule Newly created ValueRule.

inheritFromParentWithOffset

added in version 1.0.0
public static BoundsRule.ValueRule inheritFromParentWithOffset (float fraction, 
                int value)

Creates ValueRule of fraction and offset.

Parameters
fraction float: Percentage of parent.

value int: Offset

Returns
BoundsRule.ValueRule Newly created ValueRule.

setAbsoluteValue

added in version 1.0.0
public void setAbsoluteValue (int absoluteValue)

Sets the absolute/offset value for rule.

Parameters
absoluteValue int: Absolute value.

setFraction

added in version 1.0.0
public void setFraction (float fraction)

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

Parameters
fraction float: Percentage of parent.