| OLD | NEW |
| 1 part of widgets; | 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 import '../animation/curves.dart'; |
| 6 import '../animation/generator.dart'; |
| 7 import '../fn.dart'; |
| 8 import 'dart:async'; |
| 9 import 'dart:sky' as sky; |
| 2 | 10 |
| 3 const double _kSplashSize = 400.0; | 11 const double _kSplashSize = 400.0; |
| 4 const double _kSplashDuration = 500.0; | 12 const double _kSplashDuration = 500.0; |
| 5 | 13 |
| 6 class SplashAnimation { | 14 class SplashAnimation { |
| 7 AnimationGenerator _animation; | 15 AnimationGenerator _animation; |
| 8 double _offsetX; | 16 double _offsetX; |
| 9 double _offsetY; | 17 double _offsetY; |
| 10 | 18 |
| 11 Stream<String> _styleChanged; | 19 Stream<String> _styleChanged; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 27 left: ${_offsetX - p/2}px; | 35 left: ${_offsetX - p/2}px; |
| 28 width: ${p}px; | 36 width: ${p}px; |
| 29 height: ${p}px; | 37 height: ${p}px; |
| 30 border-radius: ${p}px; | 38 border-radius: ${p}px; |
| 31 opacity: ${1.0 - (p / _kSplashSize)}; | 39 opacity: ${1.0 - (p / _kSplashSize)}; |
| 32 '''); | 40 '''); |
| 33 } | 41 } |
| 34 } | 42 } |
| 35 | 43 |
| 36 class InkSplash extends Component { | 44 class InkSplash extends Component { |
| 37 | 45 static final Style _style = new Style(''' |
| 38 Stream<String> onStyleChanged; | |
| 39 | |
| 40 static Style _style = new Style(''' | |
| 41 position: absolute; | 46 position: absolute; |
| 42 pointer-events: none; | 47 pointer-events: none; |
| 43 overflow: hidden; | 48 overflow: hidden; |
| 44 top: 0; | 49 top: 0; |
| 45 left: 0; | 50 left: 0; |
| 46 bottom: 0; | 51 bottom: 0; |
| 47 right: 0; | 52 right: 0; |
| 48 '''); | 53 '''); |
| 49 | 54 |
| 50 static Style _splashStyle = new Style(''' | 55 static final Style _splashStyle = new Style(''' |
| 51 position: absolute; | 56 position: absolute; |
| 52 background-color: rgba(0, 0, 0, 0.4); | 57 background-color: rgba(0, 0, 0, 0.4); |
| 53 border-radius: 0; | 58 border-radius: 0; |
| 54 top: 0; | 59 top: 0; |
| 55 left: 0; | 60 left: 0; |
| 56 height: 0; | 61 height: 0; |
| 57 width: 0; | 62 width: 0; |
| 58 '''); | 63 '''); |
| 59 | 64 |
| 65 Stream<String> onStyleChanged; |
| 66 |
| 60 double _offsetX; | 67 double _offsetX; |
| 61 double _offsetY; | 68 double _offsetY; |
| 62 String _inlineStyle; | 69 String _inlineStyle; |
| 63 | 70 |
| 64 InkSplash(Stream<String> onStyleChanged) | 71 InkSplash(Stream<String> onStyleChanged) |
| 65 : onStyleChanged = onStyleChanged, | 72 : onStyleChanged = onStyleChanged, |
| 66 super(stateful: true, key: onStyleChanged.hashCode); | 73 super(stateful: true, key: onStyleChanged.hashCode); |
| 67 | 74 |
| 68 bool _listening = false; | 75 bool _listening = false; |
| 69 | 76 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 87 style: _style, | 94 style: _style, |
| 88 children: [ | 95 children: [ |
| 89 new Container( | 96 new Container( |
| 90 inlineStyle: _inlineStyle, | 97 inlineStyle: _inlineStyle, |
| 91 style: _splashStyle | 98 style: _splashStyle |
| 92 ) | 99 ) |
| 93 ] | 100 ] |
| 94 ); | 101 ); |
| 95 } | 102 } |
| 96 } | 103 } |
| OLD | NEW |