Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Issue 1231603003: Card "swipe-away" dismiss (Closed)

Created:
5 years, 5 months ago by hansmuller1
Modified:
5 years, 5 months ago
CC:
abarth-chromium, gregsimon, jackson_old, mojo-reviews_chromium.org, qsr+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

An example prototype of adding support for Material-style card dismissal. Many things remain to be done: - Track event.dx sum; don't listen to the card container - Make this a feature of Card - Support dismissing to the left (too) - Animate the layout change caused by dismissing the card - Deal with many cards animating away at the same time - Integrate with TBD VariableHeightScrollable This version just exists to collect a little feedback, including about the use of AnimationPerformance R=abarth@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/e7433cf734504a38b030734a31d7c920e9df6e8c

Patch Set 1 : #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -0 lines) Patch
A sky/sdk/example/widgets/card_collection.dart View 1 chunk +166 lines, -0 lines 5 comments Download

Messages

Total messages: 10 (4 generated)
hansmuller
PTAL
5 years, 5 months ago (2015-07-08 20:51:15 UTC) #4
abarth-chromium
LGTM https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets/card_collection.dart File sky/sdk/example/widgets/card_collection.dart (right): https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets/card_collection.dart#newcode74 sky/sdk/example/widgets/card_collection.dart:74: _activeCardAnchorX = event.x - event.dx; Unfortunately, the dx ...
5 years, 5 months ago (2015-07-08 21:12:02 UTC) #6
hansmuller
https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets/card_collection.dart File sky/sdk/example/widgets/card_collection.dart (right): https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets/card_collection.dart#newcode74 sky/sdk/example/widgets/card_collection.dart:74: _activeCardAnchorX = event.x - event.dx; On 2015/07/08 21:12:02, abarth-chromium ...
5 years, 5 months ago (2015-07-08 21:22:51 UTC) #7
hansmuller1
Committed patchset #1 (id:20001) manually as e7433cf734504a38b030734a31d7c920e9df6e8c (presubmit successful).
5 years, 5 months ago (2015-07-08 21:31:35 UTC) #8
Matt Perry
https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets/card_collection.dart File sky/sdk/example/widgets/card_collection.dart (right): https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets/card_collection.dart#newcode51 sky/sdk/example/widgets/card_collection.dart:51: if (_activeCardAnimation.isCompleted && !_activeCardDragUnderway) would this be simpler if ...
5 years, 5 months ago (2015-07-08 22:21:59 UTC) #9
hansmuller
5 years, 5 months ago (2015-07-08 23:07:15 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets...
File sky/sdk/example/widgets/card_collection.dart (right):

https://codereview.chromium.org/1231603003/diff/20001/sky/sdk/example/widgets...
sky/sdk/example/widgets/card_collection.dart:51: if
(_activeCardAnimation.isCompleted && !_activeCardDragUnderway)
On 2015/07/08 22:21:59, Matt Perry wrote:
> would this be simpler if AnimationPerformance supplied an "animationComplete"
> callback?

I'm not sure. I'd still need to add a callback with 
activeCardAnimation.timeline.onValueChanged.listen(), since dragging a card
updates the progress property (which defines the cards opacity and translation).
Dragging the card can cause the animation to "complete" repeatedly.  I could
write:

activeCardAnimation.timeline.onValueChanged.listen(scheduleBuild);

- and - 

activeCardAnimation.onCompleted = (_) {
  setState(() {                                
    if (!_activeCardDragUnderway)
      _dismissedCardIndices.add(_activeCardIndex);
   })
}

I guess that doesn't seem clearer.

Powered by Google App Engine
This is Rietveld 408576698