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

Side by Side Diff: sky/sdk/lib/framework/components2/drawer.dart

Issue 1173683003: [DO NOT CHECK IN] my debugging state for the assert when the drawer opens and closes prematurely (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import '../animation/animated_value.dart'; 5 import '../animation/animated_value.dart';
6 import '../animation/curves.dart'; 6 import '../animation/curves.dart';
7 import '../fn2.dart'; 7 import '../fn2.dart';
8 import '../theme2/colors.dart'; 8 import '../theme2/colors.dart';
9 import '../theme2/shadows.dart'; 9 import '../theme2/shadows.dart';
10 import 'animated_component.dart'; 10 import 'animated_component.dart';
(...skipping 22 matching lines...) Expand all
33 void _checkValue() { 33 void _checkValue() {
34 var newClosedState = isClosed; 34 var newClosedState = isClosed;
35 if (onStatusChange != null && _oldClosedState != newClosedState) { 35 if (onStatusChange != null && _oldClosedState != newClosedState) {
36 onStatusChange(!newClosedState); 36 onStatusChange(!newClosedState);
37 _oldClosedState = newClosedState; 37 _oldClosedState = newClosedState;
38 } 38 }
39 } 39 }
40 40
41 bool get isClosed => position.value == -_kWidth; 41 bool get isClosed => position.value == -_kWidth;
42 bool get _isMostlyClosed => position.value <= -_kWidth / 2; 42 bool get _isMostlyClosed => position.value <= -_kWidth / 2;
43 void toggle(_) => _isMostlyClosed ? _open() : _close(); 43 void toggle() => _isMostlyClosed ? _open() : _close();
44 44
45 void handleMaskTap(_) => _close(); 45 void handleMaskTap(_) => _close();
46 void handlePointerDown(_) => position.stop(); 46 void handlePointerDown(_) => position.stop();
47 47
48 void handlePointerMove(sky.PointerEvent event) { 48 void handlePointerMove(sky.PointerEvent event) {
49 if (position.isAnimating) 49 if (position.isAnimating)
50 return; 50 return;
51 position.value = math.min(0.0, math.max(position.value + event.dx, -_kWidth) ); 51 position.value = math.min(0.0, math.max(position.value + event.dx, -_kWidth) );
52 } 52 }
53 53
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 new StackContainer( 133 new StackContainer(
134 children: [ mask, content ] 134 children: [ mask, content ]
135 ), 135 ),
136 onPointerDown: controller.handlePointerDown, 136 onPointerDown: controller.handlePointerDown,
137 onPointerMove: controller.handlePointerMove, 137 onPointerMove: controller.handlePointerMove,
138 onPointerUp: controller.handlePointerUp, 138 onPointerUp: controller.handlePointerUp,
139 onPointerCancel: controller.handlePointerCancel 139 onPointerCancel: controller.handlePointerCancel
140 ); 140 );
141 } 141 }
142 } 142 }
OLDNEW
« no previous file with comments | « sky/examples/stocks2/lib/stock_app.dart ('k') | sky/sdk/lib/framework/components2/scaffold.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698