Commit 8417fb62 authored by Eric Seidel's avatar Eric Seidel

Merge pull request #571 from eseidelGoogle/splash

Attempt to make our splashes closer to other Android apps
parents 5bbf0d89 cd5715bb
...@@ -38,8 +38,7 @@ class StockRow extends Component { ...@@ -38,8 +38,7 @@ class StockRow extends Component {
]; ];
// TODO(hansmuller): An explicit |height| shouldn't be needed // TODO(hansmuller): An explicit |height| shouldn't be needed
return new InkWell( return new Container(
child: new Container(
padding: const EdgeDims(16.0, 16.0, 20.0, 16.0), padding: const EdgeDims(16.0, 16.0, 20.0, 16.0),
height: kHeight, height: kHeight,
decoration: new BoxDecoration( decoration: new BoxDecoration(
...@@ -60,7 +59,6 @@ class StockRow extends Component { ...@@ -60,7 +59,6 @@ class StockRow extends Component {
) )
) )
]) ])
)
); );
} }
} }
...@@ -26,8 +26,15 @@ class ThemeData { ...@@ -26,8 +26,15 @@ class ThemeData {
// Some users want the pre-multiplied color, others just want the opacity. // Some users want the pre-multiplied color, others just want the opacity.
hintColor = brightness == ThemeBrightness.dark ? const Color(0x42FFFFFF) : const Color(0x4C000000), hintColor = brightness == ThemeBrightness.dark ? const Color(0x42FFFFFF) : const Color(0x4C000000),
hintOpacity = brightness == ThemeBrightness.dark ? 0.26 : 0.30, hintOpacity = brightness == ThemeBrightness.dark ? 0.26 : 0.30,
highlightColor = const Color(0x66999999), // TODO(eseidel): Where are highlight and selected colors documented?
selectedColor = const Color(0x33999999), // I flipped highlight/selected to match the News app (which is clearly not quite Material)
// Gmail has an interesting behavior of showing selected darker until
// you click on a different drawer item when the first one loses its
// selected color and becomes lighter, the ink then fills to make the new
// click dark to match the previous (resting) selected state. States
// revert when you cancel the tap.
highlightColor = const Color(0x33999999),
selectedColor = const Color(0x66999999),
text = brightness == ThemeBrightness.dark ? typography.white : typography.black { text = brightness == ThemeBrightness.dark ? typography.white : typography.black {
assert(brightness != null); assert(brightness != null);
......
...@@ -13,11 +13,11 @@ import 'package:sky/rendering/object.dart'; ...@@ -13,11 +13,11 @@ import 'package:sky/rendering/object.dart';
import 'package:sky/widgets/basic.dart'; import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/framework.dart'; import 'package:sky/widgets/framework.dart';
const int _kSplashInitialOpacity = 0x80; const int _kSplashInitialOpacity = 0x30;
const double _kSplashCancelledVelocity = 0.3; const double _kSplashCancelledVelocity = 0.7;
const double _kSplashConfirmedVelocity = 0.3; const double _kSplashConfirmedVelocity = 0.7;
const double _kSplashInitialSize = 0.0; const double _kSplashInitialSize = 0.0;
const double _kSplashUnconfirmedVelocity = 0.1; const double _kSplashUnconfirmedVelocity = 0.2;
double _getSplashTargetSize(Size bounds, Point position) { double _getSplashTargetSize(Size bounds, Point position) {
double d1 = (position - bounds.topLeft(Point.origin)).distance; double d1 = (position - bounds.topLeft(Point.origin)).distance;
...@@ -72,7 +72,7 @@ class InkSplash { ...@@ -72,7 +72,7 @@ class InkSplash {
} }
void paint(PaintingCanvas canvas) { void paint(PaintingCanvas canvas) {
int opacity = (_kSplashInitialOpacity * (1.0 - (_radius.value / _targetRadius))).floor(); int opacity = (_kSplashInitialOpacity * (1.1 - (_radius.value / _targetRadius))).floor();
sky.Paint paint = new sky.Paint()..color = new sky.Color(opacity << 24); sky.Paint paint = new sky.Paint()..color = new sky.Color(opacity << 24);
double radius = _pinnedRadius == null ? _radius.value : _pinnedRadius; double radius = _pinnedRadius == null ? _radius.value : _pinnedRadius;
canvas.drawCircle(position, radius, paint); canvas.drawCircle(position, radius, paint);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment