CompositeDrawable.ChildDrawable


public final class CompositeDrawable.ChildDrawable


Wrapper class holding a drawable object and BoundsRule to update drawable bounds when parent bound changes.

Summary

Constants

static final Property<CompositeDrawable.ChildDrawableInteger>

Implementation of Property for overrideBottom attribute.

static final Property<CompositeDrawable.ChildDrawableFloat>

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable.

static final Property<CompositeDrawable.ChildDrawableInteger>

Implementation of Property for overrideLeft attribute.

static final Property<CompositeDrawable.ChildDrawableFloat>

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable.

static final Property<CompositeDrawable.ChildDrawableInteger>

Implementation of Property for overrideRight attribute.

static final Property<CompositeDrawable.ChildDrawableFloat>

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable.

static final Property<CompositeDrawable.ChildDrawableInteger>

Implementation of Property for overrideTop attribute.

static final Property<CompositeDrawable.ChildDrawableFloat>

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable.

Public constructors

ChildDrawable(
    @NonNull Drawable drawable,
    @NonNull CompositeDrawable parent
)

Public methods

@NonNull BoundsRule

Returns the instance of BoundsRule.

@NonNull Drawable

Returns the Drawable.

void

After changing the BoundsRule, user should call this function for the drawable to recalculate its bounds.

Constants

BOTTOM_ABSOLUTE

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableIntegerBOTTOM_ABSOLUTE

Implementation of Property for overrideBottom attribute.

BOTTOM_FRACTION

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableFloatBOTTOM_FRACTION

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable. This allows users to change the bounds rules as a percentage of parent size. This is preferable over BOTTOM_ABSOLUTE when the exact start/end position of scroll movement isn't available at compile time.

LEFT_ABSOLUTE

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableIntegerLEFT_ABSOLUTE

Implementation of Property for overrideLeft attribute.

LEFT_FRACTION

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableFloatLEFT_FRACTION

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable. This allows users to change the bounds rules as a percentage of parent size. This is preferable over LEFT_ABSOLUTE when the exact start/end position of scroll movement isn't available at compile time.

RIGHT_ABSOLUTE

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableIntegerRIGHT_ABSOLUTE

Implementation of Property for overrideRight attribute.

RIGHT_FRACTION

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableFloatRIGHT_FRACTION

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable. This allows users to change the bounds rules as a percentage of parent size. This is preferable over RIGHT_ABSOLUTE when the exact start/end position of scroll movement isn't available at compile time.

TOP_ABSOLUTE

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableIntegerTOP_ABSOLUTE

Implementation of Property for overrideTop attribute.

TOP_FRACTION

Added in 1.1.0
public static final Property<CompositeDrawable.ChildDrawableFloatTOP_FRACTION

Implementation of Property for overwriting the bottom attribute of BoundsRule associated with this ChildDrawable. This allows users to change the bounds rules as a percentage of parent size. This is preferable over TOP_ABSOLUTE when the exact start/end position of scroll movement isn't available at compile time.

Public constructors

ChildDrawable

Added in 1.1.0
public ChildDrawable(
    @NonNull Drawable drawable,
    @NonNull CompositeDrawable parent
)

Public methods

getBoundsRule

Added in 1.1.0
public @NonNull BoundsRule getBoundsRule()

Returns the instance of BoundsRule.

getDrawable

Added in 1.1.0
public @NonNull Drawable getDrawable()

Returns the Drawable.

recomputeBounds

Added in 1.1.0
public void recomputeBounds()

After changing the BoundsRule, user should call this function for the drawable to recalculate its bounds.