| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Implementations can be used to simulate the deceleration of an element within | 6 * Implementations can be used to simulate the deceleration of an element within |
| 7 * a certain region. To use this behavior you need to provide an initial | 7 * a certain region. To use this behavior you need to provide an initial |
| 8 * velocity that is meant to represent the gesture that is initiating this | 8 * velocity that is meant to represent the gesture that is initiating this |
| 9 * deceleration. You also provide the bounds of the region that the element | 9 * deceleration. You also provide the bounds of the region that the element |
| 10 * exists in, and the current offset of the element within that region. The | 10 * exists in, and the current offset of the element within that region. The |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 /** null if no transition is in progress. */ | 64 /** null if no transition is in progress. */ |
| 65 Coordinate get destination; | 65 Coordinate get destination; |
| 66 } | 66 } |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Momentum Delegate interface. | 69 * Momentum Delegate interface. |
| 70 * You are required to implement this interface in order to use the | 70 * You are required to implement this interface in order to use the |
| 71 * Momentum behavior. | 71 * Momentum behavior. |
| 72 */ | 72 */ |
| 73 interface MomentumDelegate { | 73 abstract class MomentumDelegate { |
| 74 /** | 74 /** |
| 75 * Callback for a deceleration step. The delegate is responsible for redrawing | 75 * Callback for a deceleration step. The delegate is responsible for redrawing |
| 76 * the element in its new position specified in px. | 76 * the element in its new position specified in px. |
| 77 */ | 77 */ |
| 78 void onDecelerate(num x, num y); | 78 void onDecelerate(num x, num y); |
| 79 | 79 |
| 80 /** | 80 /** |
| 81 * Callback for end of deceleration. | 81 * Callback for end of deceleration. |
| 82 */ | 82 */ |
| 83 void onDecelerationEnd(); | 83 void onDecelerationEnd(); |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 | 545 |
| 546 Coordinate get destination { | 546 Coordinate get destination { |
| 547 if (!_moves.isEmpty()) { | 547 if (!_moves.isEmpty()) { |
| 548 final lastMove = _moves.last(); | 548 final lastMove = _moves.last(); |
| 549 return new Coordinate(lastMove.x, lastMove.y); | 549 return new Coordinate(lastMove.x, lastMove.y); |
| 550 } else { | 550 } else { |
| 551 return null; | 551 return null; |
| 552 } | 552 } |
| 553 } | 553 } |
| 554 } | 554 } |
| OLD | NEW |