2592 Commits

Author SHA1 Message Date
Adam Barth
262dd7a63b Add support for autolayout to widgets
This patch teaches the widget framework how to use Cassowary-based
autolayout. To integrate autolayout with widgets, I had to refactor how
RenderAutoLayout worked a bit. Now RenderAutoLayout follows the same
delegate pattern we use for custom paint and custom layout.
2016-02-15 03:01:40 -08:00
Adam Barth
2bb268492c Improve checkbox animation
This patch improves the checkbox animation as suggested by the design
team. The color transition now occurs earlier in the animation and there
are fewer components to the animation.

Fixes #1614
2016-02-14 18:01:15 -08:00
Ian Hickson
aa41783ae3 Merge pull request #1877 from Hixie/onPressed-disabled
Document the onPressed/disabled behavior.
2016-02-14 13:57:42 -08:00
Ian Hickson
8ff177f832 Document the onPressed/disabled behavior.
Fixes https://github.com/flutter/flutter/issues/1331

Hopefully this will be enough to start with. If this continues to be a
point of confusion we can see about adding more documentation or
changing the API somehow.
2016-02-14 11:06:11 -08:00
Ian Hickson
86366626f0 Merge pull request #1873 from Hixie/debugFillDescription
Rename debugDescribeSettings to debugFillDescription.
2016-02-14 11:05:31 -08:00
Ian Hickson
0334a833ef Rename debugDescribeSettings to debugFillDescription.
...so that it's easier to copy/paste between the rendering and settings layers.
2016-02-13 23:23:45 -08:00
Adam Barth
4fb47600e4 Add a Velocity class to be explicit about units
We were using an Offset, which represented pixels/second, but it wasn't
clear to clients whether that was pixels/ms. Now we use a Velocity class
that is explict about the units.

Fixes #1510
Fixes #785
2016-02-13 22:59:09 -08:00
Ian Hickson
f54b8ad510 Use Image.toString instead of rolling our own each time
I meant to check this in as part of https://github.com/flutter/flutter/pull/1852
but forgot to commit the local change, d'oh.
2016-02-13 17:54:10 -08:00
Ian Hickson
3eb1b412e0 Fix color of icons in drawers in dark theme.
This makes it match the material spec more.
https://www.google.com/design/spec/style/icons.html

Fixes https://github.com/flutter/flutter/issues/1357
2016-02-13 17:10:10 -08:00
Adam Barth
deb9d0b3a0 Remove references to dart:ui_internals
This library is being folded into dart:ui.

Fixes #83
2016-02-13 13:12:30 -08:00
Ian Hickson
8db6f5b127 Merge pull request #1833 from Hixie/progress-nits
SawTooth
2016-02-12 19:09:17 -08:00
Ian Hickson
601089ecf1 Merge pull request #1829 from Hixie/size-obs-2
SizeObserver crusade: drawer
2016-02-12 18:15:45 -08:00
Ian Hickson
c0c2277767 Merge pull request #1849 from Hixie/drag-horiz
Horizontal and Vertical Draggables
2016-02-12 17:59:35 -08:00
Collin Jackson
6c2ab9d352 Merge pull request #1847 from collinjackson/input_key
Don’t require global keys for Input, fixes #1828
2016-02-12 17:58:08 -08:00
Hixie
e5cf7fe37f SizeObserver crusade: drawer
Drawer doesn't need a SizeObserver, since it only looks at the size
in event handlers. It can just go and probe the tree to read the size.

Also, change from using _kEdgeDragWidth to using _kWidth when figuring
out how much of the drawer to show when dragging it from the edge, since
that is more likely to match the drawer's width.
2016-02-12 17:26:52 -08:00
Ian Hickson
ca4d10d33a Merge pull request #1820 from Hixie/rainbox
Expose more debugging tools in Stocks
2016-02-12 17:21:16 -08:00
Hixie
19a2f5ef74 Horizontal and Vertical Draggables 2016-02-12 17:16:39 -08:00
Collin Jackson
d4533622e1 Don’t require global keys for Input, fixes #1828 2016-02-12 16:56:10 -08:00
Hixie
7c23ededef SawTooth 2016-02-12 14:20:37 -08:00
Hixie
334fcbbf44 Draggables were disappearing
I forgot to wrap the state changing in a setState. Oops.
2016-02-12 14:03:47 -08:00
Adam Barth
baca514f99 Merge pull request #1827 from abarth/scrollable_list_padding
Fix padding for ScrollableList
2016-02-12 13:59:59 -08:00
Adam Barth
ad2fa5a6e7 Fix padding for ScrollableList
Previously we had totally wrong behavior. Now we have more correct behavior and
testing.

Fixes #1808
2016-02-12 13:39:05 -08:00
Hixie
fd7be69df0 SizeObserver crusade: snap alignment
Remove the SizeObserver you need to use snap alignment in lists by
having the lists provide the size themselves in the callback.

Also, remove snapAlignmentOffset since we couldn't figure out how to
explain it and it's not really needed.
2016-02-12 12:40:44 -08:00
Hixie
a95c866bf3 Expose more debugging tools in Stocks 2016-02-12 11:41:17 -08:00
Hans Muller
78b3096126 colors demo 2016-02-12 11:31:08 -08:00
Ian Hickson
f8f50ae713 Merge pull request #1804 from Hixie/progress-nits
Clean-up around progress indicators.
2016-02-12 10:53:03 -08:00
Ian Hickson
d2c3275086 Merge pull request #1791 from Hixie/custom-paint-saves
Assert that custom painters balance save/restores.
2016-02-12 09:54:34 -08:00
Hixie
2c69f2429f Clean-up around progress indicators.
Move StepTween to tween.dart.

Move _buildIndicator() methods to be next to the build() methods they're
used from, so that reading the code is easier.

Fix typos, add some comments, style nits.
2016-02-12 09:28:56 -08:00
Adam Barth
78181d82e7 Merge pull request #1798 from abarth/image_cache
ImageCache should be a public type
2016-02-12 09:08:40 -08:00
Ian Hickson
ecdd55e4cd Merge pull request #1796 from abarth/progress_nits
Fix style nits in progress_indicator.dart
2016-02-12 08:46:43 -08:00
Hixie
0d1a3cfcff Assert that custom painters balance save/restores. 2016-02-12 08:35:45 -08:00
Ian Hickson
16ecfeb074 Merge pull request #1797 from Hixie/toString
toString for Tween and ThemeData
2016-02-12 07:16:53 -08:00
Adam Barth
45c4069070 ImageCache should be a public type
We expose `imageCache`, which is an ImageCache, but previously the class
was private which means there was no documentation for the methods on
that object.

Fixes #1750
2016-02-11 22:33:21 -08:00
Ian Hickson
ab3b6a6eec toString for Tween and ThemeData 2016-02-11 22:25:39 -08:00
Adam Barth
0ae02d2f95 Fix style nits in progress_indicator.dart
This patch tightens up the imports in this file and hides some more of
the implementation details by making RepeatingCurveTween and StepTween
private.

Also, removed a CurvedAnimation with a linear curve.  That's not needed
because the animation controller itself is an Animation<double>.
2016-02-11 22:20:14 -08:00
Josh Estelle
6bb7c0ae9c Implement the Material Circular Indeterminate Progress Indicator correctly to spec.
This animation expands/collapses an arc that's 3/4ths of a circle.
The next iteration begins where the previous appeared to finish.
This happens while the whole thing rotates, such that the starting point of each
expansion moves in a star-wise pattern around the circle.

See:
https://www.google.com/design/spec/components/progress-activity.html
(note: the video here demonstrating this animation is actually slightly incorrect...
we'll hopefully update it soon)
2016-02-11 22:12:15 -08:00
Ian Hickson
cd96855e50 Merge pull request #1789 from flutter/Hixie-patch-1
Ticker typedef had no defined return type
2016-02-11 17:00:16 -08:00
Hixie
6b487e4ecc Refactor MultiDragPointerState to support delays
...even after winning the arena.
2016-02-11 16:48:17 -08:00
Ian Hickson
4d90194eff Ticker typedef had no defined return type 2016-02-11 15:39:59 -08:00
Jason Simmons
279c6149c5 Merge pull request #1747 from jason-simmons/input_field_clear
Change the text/selection value API of the input field
2016-02-11 13:46:13 -08:00
Hixie
8e279f320e Provide a Draggable that starts on drag
This lets it cooperate with other gestures like tap.

The way I implemented this was to refactor the entire Draggable gesture
logic to use a new kind of gesture detector called
MultiDragGestureRecognizer. It works a bit like
MultiTapGestureRecognizer but for drags.

Also some tweaks to the velocity estimator.
2016-02-11 12:54:10 -08:00
Jason Simmons
52c55344d9 Change the text/selection value API of the input field
(see https://github.com/flutter/flutter/issues/1586)
2016-02-11 12:52:15 -08:00
Ian Hickson
a94999ba50 Clean up imports and exports.
Each layer is supposed to reexport the parts of the previous layer
that are part of its API.

- In painting.dart, export from dart:ui all the Canvas-related APIs
  that make sense to be used at higher levels, e.g. PaintingStyle.

- Delete painting/shadows.dart. It was dead code.

- In rendering/object.dart, export all of painting.dart.

- In widgets/basic.dart, export all of painting.dart and
  animation.dart. Some classes in animation/ are renamed to make this
  less disruptive and confusing to the namespace.

- Split out Stocks back into an import model rather than a part model,
  so that it's easier to manage its dependencies on a per-file basis.

- Move Ticker to scheduler library.

- Remove as many redundant imports as possible now.

- Some minor nit picking cleanup in various files.
2016-02-11 00:06:23 -08:00
Adam Barth
fc23277df5 Cleanup MixedViewport
This patch fixes a couple minor bugs and cleans up MixedViewport a bit.
2016-02-10 23:24:28 -08:00
Adam Barth
40151689f1 ScrollableList was applying padding twice
We need to subtract the padding instead of adding it.
2016-02-10 15:51:25 -08:00
Hixie
296540168a More BoxConstraints asserts
The asserting will continue until morale improves!

* Convert all assert(*.isNormalized) checks to use the new
  debugAssertIsNormalized technology.
* Convert CustomMultiChildLayout to use the new RenderingError
  technology to greatly improve the detail in errors you get when
  writing CustomMultiChildLayout delegates.
* Add BoxConstraints.copyWith().
* Indent the descendants in the rendering exception data dump so that
  when you have multiple children it's clearer what's going on.
2016-02-10 13:32:04 -08:00
Adam Barth
64f588c12b Merge pull request #1761 from abarth/min_scroll_behavior
ScrollBehavior should support negative min scroll offset
2016-02-10 12:42:14 -08:00
Adam Barth
ec9ab32435 ScrollBehavior should support negative min scroll offset
Fixes #1730
2016-02-10 12:13:20 -08:00
Hixie
3bd8bc3362 Improve asserts around BoxConstraints
Negative constraints never make sense, so catch those too.

Make RenderObject.layout's isNormalized assert use the newer more fancy
debug version of isNormalized.
2016-02-10 11:12:13 -08:00
Adam Barth
4ba5e712bc Teach PageableList about scroll anchors 2016-02-10 10:34:59 -08:00