Material Motion Exploring solutions that will empower creators with the tools needed to describe and implement rich, interactive motion on any platform. Edit this page · History
$._nextOperator thresholdRange
threshold
rewrite
slop
Status Interface level Implementation level Library
Stable as of February 21, 2016 L2: Interaction creator L3: Stream creator material-motion
platformsrctests
Android View
iOS (Swift) View View
thresholdRange
upstream (number)
min (number)
max (number)
(ThresholdSide) downstream

thresholdRange specification

This is the engineering specification for the MotionObservable operator: thresholdRange.

Overview

thresholdRange emits a value based on the incoming value’s position around a threshold range.

Example usage

stream.thresholdRange(min: 50, max: 100)

upstream min max  |  downstream
20       50  100  |  .below
50       50  100  |  .within
100      50  100  |  .within
120      50  100  |  .above

MVP

Expose a thresholdRange operator API

Use _nextOperator to implement the operator. Accept a threshold minimum and maximum value.

class MotionObservable<number> {
  public func thresholdRange(min: number, max: number) -> MotionObservable<ThresholdSide>