提交 ca60f330 编写于 作者: A Adam Barth

Move animationgenerator.dart to sky/framework/animation/generator.dart

That's where it belongs.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/979283002
上级 1f77a79a
......@@ -2,6 +2,7 @@ library widgets;
import '../../../framework/animation/curves.dart';
import '../../../framework/animation/fling-curve.dart';
import '../../../framework/animation/generator.dart';
import '../../../framework/fn.dart';
import '../../../framework/theme/colors.dart';
import '../../../framework/theme/shadows.dart';
......@@ -10,7 +11,6 @@ import 'dart:async';
import 'dart:math' as math;
import 'dart:sky' as sky;
part 'animationgenerator.dart';
part 'box.dart';
part 'button.dart';
part 'buttonbase.dart';
......
part of widgets;
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
class FrameGenerator {
import 'curves.dart';
import 'dart:async';
import 'dart:math' as math;
import 'dart:sky' as sky;
class FrameGenerator {
Function onDone;
StreamController _controller;
......@@ -46,7 +52,6 @@ class FrameGenerator {
}
class AnimationGenerator extends FrameGenerator {
Stream<double> get onTick => _stream;
final double duration;
final double begin;
......@@ -62,12 +67,9 @@ class AnimationGenerator extends FrameGenerator {
Function onDone
}):super(onDone: onDone) {
double startTime = 0.0;
double targetTime = 0.0;
_stream = super.onTick.map((timeStamp) {
if (startTime == 0.0) {
if (startTime == 0.0)
startTime = timeStamp;
targetTime = startTime + duration;
}
return math.min((timeStamp - startTime) / duration, 1.0);
})
.takeWhile(_checkForCompletion)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册