-
public final class ComparatorsKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> <ERROR CLASS><T>)>combineComparators(<ERROR CLASS><T> comparators)Combines multiple comparators in priority order. final static <T extends Any> <ERROR CLASS><T>)>conditional(Function2<T, T, Boolean> predicate, <ERROR CLASS><T> comparator)Returns a comparator that delegates to comparator only when predicate returns true for the pair, otherwise returns 0 (preserving order). final static <ERROR CLASS><ParticipantState>)>ifInvisible(<ERROR CLASS><ParticipantState> comparator)Wraps comparator so it only applies when at least one participant in a pair has visibility state VisibilityOnScreenState.INVISIBLE. final static <ERROR CLASS><ParticipantState>)>ifInvisibleOrUnknown(<ERROR CLASS><ParticipantState> comparator)Wraps comparator so it applies when at least one participant has visibility state VisibilityOnScreenState.INVISIBLE or VisibilityOnScreenState.UNKNOWN. -
-
Method Detail
-
combineComparators
final static <T extends Any> <ERROR CLASS><T> )>combineComparators(<ERROR CLASS><T> comparators)
Combines multiple comparators in priority order. The first comparator that returns a non-zero result determines the ordering; subsequent comparators are skipped for that pair. Mirrors
combineComparatorsfrom stream-video-js.
-
conditional
final static <T extends Any> <ERROR CLASS><T> )>conditional(Function2<T, T, Boolean> predicate, <ERROR CLASS><T> comparator)
Returns a comparator that delegates to comparator only when predicate returns true for the pair, otherwise returns 0 (preserving order). Mirrors
conditionalfrom stream-video-js.
-
ifInvisible
final static <ERROR CLASS><ParticipantState> )>ifInvisible(<ERROR CLASS><ParticipantState> comparator)
Wraps comparator so it only applies when at least one participant in a pair has visibility state VisibilityOnScreenState.INVISIBLE. When both are VisibilityOnScreenState.VISIBLE (or VisibilityOnScreenState.UNKNOWN) the pair is left in place (returns 0). This is the speaker-layout / default-grid stability guarantee.
-
ifInvisibleOrUnknown
final static <ERROR CLASS><ParticipantState> )>ifInvisibleOrUnknown(<ERROR CLASS><ParticipantState> comparator)
Wraps comparator so it applies when at least one participant has visibility state VisibilityOnScreenState.INVISIBLE or VisibilityOnScreenState.UNKNOWN. Stricter than ifInvisible — useful for continuous-scroll grids where off-screen tiles may report UNKNOWN before they ever render. Visible/visible pairs return 0.
-
-
-
-