Commit 82b55c5c authored by Matt Perry's avatar Matt Perry Committed by GitHub

Fix gallery clipping issues on ipod touch. (#5258)

* Shrine tile height now hardcoded to match actual card size.
* Animation demo now scales with screen size.

BUG=https://github.com/flutter/flutter/issues/5002
BUG=https://github.com/flutter/flutter/issues/5003
parent 30505aef
...@@ -115,12 +115,15 @@ class _PointDemoState extends State<_PointDemo> { ...@@ -115,12 +115,15 @@ class _PointDemoState extends State<_PointDemo> {
CurvedAnimation _animation; CurvedAnimation _animation;
_DragTarget _dragTarget; _DragTarget _dragTarget;
Point _begin = const Point(180.0, 110.0); Point _begin;
Point _end = const Point(37.0, 250.0); Point _end;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
final Size screenSize = MediaQuery.of(context).size;
_begin = new Point(screenSize.width * 0.5, screenSize.height * 0.2);
_end = new Point(screenSize.width * 0.1, screenSize.height * 0.4);
_animation = new CurvedAnimation(parent: config.controller, curve: Curves.ease); _animation = new CurvedAnimation(parent: config.controller, curve: Curves.ease);
} }
...@@ -272,12 +275,21 @@ class _RectangleDemoState extends State<_RectangleDemo> { ...@@ -272,12 +275,21 @@ class _RectangleDemoState extends State<_RectangleDemo> {
CurvedAnimation _animation; CurvedAnimation _animation;
_DragTarget _dragTarget; _DragTarget _dragTarget;
Rect _begin = new Rect.fromLTRB(180.0, 100.0, 330.0, 200.0); Rect _begin;
Rect _end = new Rect.fromLTRB(32.0, 275.0, 132.0, 425.0); Rect _end;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
final Size screenSize = MediaQuery.of(context).size;
_begin = new Rect.fromLTWH(
screenSize.width * 0.5, screenSize.height * 0.2,
screenSize.width * 0.4, screenSize.height * 0.2
);
_end = new Rect.fromLTWH(
screenSize.width * 0.1, screenSize.height * 0.4,
screenSize.width * 0.3, screenSize.height * 0.3
);
_animation = new CurvedAnimation(parent: config.controller, curve: Curves.ease); _animation = new CurvedAnimation(parent: config.controller, curve: Curves.ease);
} }
......
...@@ -39,7 +39,8 @@ class ShrineGridDelegate extends GridDelegate { ...@@ -39,7 +39,8 @@ class ShrineGridDelegate extends GridDelegate {
assert(childCount >= 0); assert(childCount >= 0);
return new GridSpecification.fromRegularTiles( return new GridSpecification.fromRegularTiles(
tileWidth: constraints.maxWidth / 2.0 - 8.0, tileWidth: constraints.maxWidth / 2.0 - 8.0,
tileHeight: constraints.maxWidth * 0.67, // height = ProductPriceItem + product image + VendorItem
tileHeight: 40.0 + 144.0 + 40.0,
columnCount: 2, columnCount: 2,
rowCount: childCount == 0 ? 0 : _rowAtIndex(childCount - 1) + 1, rowCount: childCount == 0 ? 0 : _rowAtIndex(childCount - 1) + 1,
rowSpacing: 8.0, rowSpacing: 8.0,
......
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