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

Side by Side Diff: samples/swarm/swarm_ui_lib/view/ConveyorView.dart

Issue 11748016: Make ~/, round, ceil, floor, truncate return ints. Remove toInt. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Checked mode fixes. Created 7 years, 11 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) 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 part of view; 5 part of view;
6 6
7 /** 7 /**
8 * Holds a number of child views. As you switch between views, the old 8 * Holds a number of child views. As you switch between views, the old
9 * view is pushed off to the side and the new view slides in from the other 9 * view is pushed off to the side and the new view slides in from the other
10 * side. 10 * side.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 style.transitionDuration = '${durationSeconds}s'; 60 style.transitionDuration = '${durationSeconds}s';
61 final xTranslationPercent = -index * 100; 61 final xTranslationPercent = -index * 100;
62 style.transform = 'translate3d(${xTranslationPercent}%, 0px, 0px)'; 62 style.transform = 'translate3d(${xTranslationPercent}%, 0px, 0px)';
63 63
64 if (animationTimeoutId != null) { 64 if (animationTimeoutId != null) {
65 window.clearTimeout(animationTimeoutId); 65 window.clearTimeout(animationTimeoutId);
66 } 66 }
67 67
68 if (animate) { 68 if (animate) {
69 animationTimeoutId = window.setTimeout( 69 animationTimeoutId = window.setTimeout(
70 () { _onAnimationEnd(); }, (durationSeconds * 1000).toInt()); 70 () { _onAnimationEnd(); }, (durationSeconds * 1000).truncate());
71 } 71 }
72 // TODO(mattsh), we should set the visibility to hide everything but the 72 // TODO(mattsh), we should set the visibility to hide everything but the
73 // selected view. 73 // selected view.
74 } 74 }
75 75
76 int getIndexOfSelectedView() { 76 int getIndexOfSelectedView() {
77 for (int i = 0; i < childViews.length; i++) { 77 for (int i = 0; i < childViews.length; i++) {
78 if (childViews[i] == selectedView) { 78 if (childViews[i] == selectedView) {
79 return i; 79 return i;
80 } 80 }
(...skipping 10 matching lines...) Expand all
91 view.transform = 'translate3d(${(childViews.length * 100)}%, 0, 0)'; 91 view.transform = 'translate3d(${(childViews.length * 100)}%, 0, 0)';
92 return super.addChild(view); 92 return super.addChild(view);
93 } 93 }
94 94
95 void _onAnimationEnd() { 95 void _onAnimationEnd() {
96 if (viewSelected != null) { 96 if (viewSelected != null) {
97 viewSelected(selectedView); 97 viewSelected(selectedView);
98 } 98 }
99 } 99 }
100 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698