TrimConstraint

sealed interface TrimConstraint(source)

What a trim gesture is allowed to produce.

A closed type with three modes, each its own rule.

Immutable, so a timeline holding one as an option stays skippable.

Inheritors

Types

Link copied to clipboard

A range of exactly length, where moving either end slides the whole window.

Link copied to clipboard
class MinDuration(val minimum: Duration) : TrimConstraint

A range that may be any length at or above minimum.

Link copied to clipboard
class MinMaxDuration(val minimum: Duration, val maximum: Duration) : TrimConstraint

A range between minimum and maximum long.

Functions

Link copied to clipboard
abstract fun constrain(proposed: TimeRange, handle: TrimHandle, duration: Duration): TimeRange

Corrects proposed into a range this constraint allows.