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
$._map lowerBound
upperBound
Status Interface level Implementation level Library
Stable as of February 20, 2016 L2: Interaction creator L3: Stream creator material-motion
UpdatesCurrent StatusInitiation dateCompletion date
Renamed from min to lowerBound Stable February 20, 2017
platformsrctests
Android View
iOS (Swift) View View
lowerBound
upstream (Comparable)
minValue (Comparable)
(Comparable) downstream

lowerBound specification

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

Overview

lowerBound emits either the incoming value or the provided minValue, whichever is larger.

Example usage

stream.lowerBound(minValue: 0)

upstream  minValue  |  downstream
 0.50     0         |  0.50
 0.25     0         |  0.25
 0.00     0         |  0.00
-0.25     0         |  0.00
-0.50     0         |  0.00

MVP

Expose a lowerBound operator API

Use _map to implement the operator. Accept a Comparable type. Emit the result of max(upstreamValue, minValue).

class MotionObservable<Comparable> {
  public func lowerBound(minValue: Comparable) -> MotionObservable<Comparable>