[added] Swipeable interaction
Needs ReviewPublic

Authored by appsforartists on Mon, Sep 11, 10:04 PM.

Details

Summary

This is a first draft of the swipe away interaction. It can be previewed here:

https://material-motion-demos.firebaseapp.com/swipe-away/

The user can drag an item to either side of the viewport. This will dismiss the item. The user will encounter resistance up to a threshold. If the user releases before the threshold is met, the item will spring back to its origin.

Diff Detail

Repository
R13 material-motion/material-motion-js
Branch
swipe-to-dismiss (branched from develop)
Lint
Lint SkippedExcuse: wip
Unit
Unit Tests Skipped
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptMon, Sep 11, 10:04 PM
Restricted Application added a project: Material Motion. · View Herald Transcript
Restricted Application added a reviewer: O3: Material JavaScript platform reviewers. · View Herald Transcript
Restricted Application added a reviewer: Material Motion. · View Herald Transcript
appsforartists planned changes to this revision.Mon, Sep 11, 10:05 PM
Restricted Application failed to build Restricted Buildable!Mon, Sep 11, 10:35 PM

This is close enough for now - improvements can be added in later diffs

Restricted Application failed to build Restricted Buildable!Tue, Sep 12, 10:59 PM

I fixed the wobble#5, which makes it safe to set draggedX$ to destination$.

Setting draggedX$ directly to destination$ also fixes a bug where dragging back to the origin-side of the threshold while the spring was active would get the item stuck at the resistance threshold (since thresholdMet$.rewriteTo() fails from that side of the threshold).

Restricted Application completed building Restricted Buildable.Wed, Sep 13, 9:27 PM
appsforartists edited the summary of this revision. (Show Details)Tue, Sep 19, 7:12 PM