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
distanceFrom abs
Status Interface level Implementation level Library
Stable as of April 20, 2017 L2: Interaction creator L3: Stream creator material-motion
platformsrctests
iOS (Swift) View View
abs
upstream (number)
(number) downstream

abs specification

This is an alias for a hypothetical operator, abs.

Overview

abs emits the absolute value of a number. We recommend using distanceFrom(0) to achieve this result.

Example usage

stream.distanceFrom(0)

upstream  |  downstream
 20       |  20
-1        |  1
-50       |  50