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

Side by Side Diff: samples/swipe/web/swipe.dart

Issue 12793003: Rename Timer.repeating to Timer.periodic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library swipe; 5 library swipe;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:math'; 9 import 'dart:math';
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 /** 108 /**
109 * Start an indefinite spin in the given direction. 109 * Start an indefinite spin in the given direction.
110 */ 110 */
111 void startSpin(Element figure, int direction) { 111 void startSpin(Element figure, int direction) {
112 // If we're not already spinning - 112 // If we're not already spinning -
113 if (timer == null) { 113 if (timer == null) {
114 spinFigure(figure, direction); 114 spinFigure(figure, direction);
115 115
116 timer = new Timer.repeating(const Duration(milliseconds: 100), 116 timer = new Timer.periodic(const Duration(milliseconds: 100),
117 (Timer t) => spinFigure(figure, direction)); 117 (Timer t) => spinFigure(figure, direction));
118 } 118 }
119 } 119 }
120 120
121 /** 121 /**
122 * Stop any spin that may be in progress. 122 * Stop any spin that may be in progress.
123 */ 123 */
124 void stopSpin() { 124 void stopSpin() {
125 if (timer != null) { 125 if (timer != null) {
126 timer.cancel(); 126 timer.cancel();
127 timer = null; 127 timer = null;
128 } 128 }
129 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698