| OLD | NEW |
| 1 part of view; | |
| 2 | |
| 3 // 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 |
| 4 // 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 |
| 5 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 6 | 4 |
| 7 class PageState { | 5 class PageState { |
| 8 final ObservableValue<int> current; | 6 final ObservableValue<int> current; |
| 9 final ObservableValue<int> target; | 7 final ObservableValue<int> target; |
| 10 final ObservableValue<int> length; | 8 final ObservableValue<int> length; |
| 11 PageState() : | 9 PageState() : |
| 12 current = new ObservableValue<int>(0), | 10 current = new ObservableValue<int>(0), |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return perPage * (columnSize + _columnGap); | 278 return perPage * (columnSize + _columnGap); |
| 281 } | 279 } |
| 282 | 280 |
| 283 void _onPageSelected() { | 281 void _onPageSelected() { |
| 284 _container.rect.then((ElementRect rect) { | 282 _container.rect.then((ElementRect rect) { |
| 285 int translate = -pages.target.value * _computePageSize(rect); | 283 int translate = -pages.target.value * _computePageSize(rect); |
| 286 scroller.throwTo(translate, 0); | 284 scroller.throwTo(translate, 0); |
| 287 }); | 285 }); |
| 288 } | 286 } |
| 289 } | 287 } |
| OLD | NEW |