Commit cd5715bb authored by Eric Seidel's avatar Eric Seidel

Attempt to make our splashes closer to other Android apps

And also Material Design of course.

@abarth
parent 1ca858b9
......@@ -38,29 +38,27 @@ class StockRow extends Component {
];
// TODO(hansmuller): An explicit |height| shouldn't be needed
return new InkWell(
child: new Container(
padding: const EdgeDims(16.0, 16.0, 20.0, 16.0),
height: kHeight,
decoration: new BoxDecoration(
border: new Border(
bottom: new BorderSide(color: Theme.of(this).dividerColor)
)
return new Container(
padding: const EdgeDims(16.0, 16.0, 20.0, 16.0),
height: kHeight,
decoration: new BoxDecoration(
border: new Border(
bottom: new BorderSide(color: Theme.of(this).dividerColor)
)
),
child: new Flex([
new Container(
child: new StockArrow(percentChange: stock.percentChange),
margin: const EdgeDims.only(right: 5.0)
),
child: new Flex([
new Container(
child: new StockArrow(percentChange: stock.percentChange),
margin: const EdgeDims.only(right: 5.0)
),
new Flexible(
child: new Flex(
children,
alignItems: FlexAlignItems.baseline,
textBaseline: DefaultTextStyle.of(this).textBaseline
)
new Flexible(
child: new Flex(
children,
alignItems: FlexAlignItems.baseline,
textBaseline: DefaultTextStyle.of(this).textBaseline
)
])
)
)
])
);
}
}
......@@ -26,8 +26,15 @@ class ThemeData {
// Some users want the pre-multiplied color, others just want the opacity.
hintColor = brightness == ThemeBrightness.dark ? const Color(0x42FFFFFF) : const Color(0x4C000000),
hintOpacity = brightness == ThemeBrightness.dark ? 0.26 : 0.30,
highlightColor = const Color(0x66999999),
selectedColor = const Color(0x33999999),
// TODO(eseidel): Where are highlight and selected colors documented?
// 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 {
assert(brightness != null);
......
......@@ -13,11 +13,11 @@ import 'package:sky/rendering/object.dart';
import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/framework.dart';
const int _kSplashInitialOpacity = 0x80;
const double _kSplashCancelledVelocity = 0.3;
const double _kSplashConfirmedVelocity = 0.3;
const int _kSplashInitialOpacity = 0x30;
const double _kSplashCancelledVelocity = 0.7;
const double _kSplashConfirmedVelocity = 0.7;
const double _kSplashInitialSize = 0.0;
const double _kSplashUnconfirmedVelocity = 0.1;
const double _kSplashUnconfirmedVelocity = 0.2;
double _getSplashTargetSize(Size bounds, Point position) {
double d1 = (position - bounds.topLeft(Point.origin)).distance;
......@@ -72,7 +72,7 @@ class InkSplash {
}
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);
double radius = _pinnedRadius == null ? _radius.value : _pinnedRadius;
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