DampingNode


public final class DampingNode extends ValueNode


A ValueNode that damps changes in an input value, causing the output value to slowly follow changes in the input value over a specified time or distance.

Summary

Public constructors

DampingNode(
    @NonNull ProgressDomain dampingSource,
    float dampingGap,
    @NonNull ValueNode input
)

Creates a DampingNode that damps changes in an input value, causing the output value to slowly follow changes in the input value over a specified time or distance.

Public methods

boolean
equals(Object other)
final float

The amount of damping to apply.

final @NonNull ProgressDomain

The source of the damping.

final @NonNull ValueNode

The input node that produces the value to be modified by the damping.

int
@NonNull String

Inherited methods

From androidx.ink.brush.behavior.Node
final @NonNull List<@NonNull ValueNode>

The ordered list of inputs that this node directly depends on.

Public constructors

DampingNode

Added in 1.1.0-alpha03
public DampingNode(
    @NonNull ProgressDomain dampingSource,
    float dampingGap,
    @NonNull ValueNode input
)

Creates a DampingNode that damps changes in an input value, causing the output value to slowly follow changes in the input value over a specified time or distance.

If dampingSource is ProgressDomain.DISTANCE_IN_CENTIMETERS and the stroke input data does not indicate the relationship between stroke units and physical units (e.g. as may be the case for programmatically-generated inputs), then the output value will be null regardless of the input.

Parameters
@NonNull ProgressDomain dampingSource

the source of the damping

float dampingGap

the amount of damping to apply

@NonNull ValueNode input

input node that produces the value to be modified by the damping

Public methods

equals

public boolean equals(Object other)

getDampingGap

Added in 1.1.0-alpha03
public final float getDampingGap()

The amount of damping to apply.

getDampingSource

Added in 1.1.0-alpha03
public final @NonNull ProgressDomain getDampingSource()

The source of the damping.

getInput

Added in 1.1.0-alpha03
public final @NonNull ValueNode getInput()

The input node that produces the value to be modified by the damping.

hashCode

public int hashCode()

toString

public @NonNull String toString()