1129 Commits

Author SHA1 Message Date
Adam Barth
5d99f31c04 Merge pull request #767 from abarth/modernize_drawer_item
DrawerItem, DrawerHeader should take a child instead of children
2015-08-22 08:46:12 -07:00
Adam Barth
2873880f50 Fix analyzer warnings 2015-08-22 08:24:02 -07:00
Adam Barth
18248543cb DrawerItem, DrawerHeader should take a child instead of children
These widgets were designed in CSS where you need to specify a layout model for
your children. This patch updates them to the modern style of just taking a
unique child.

Fixes #755
2015-08-22 08:19:38 -07:00
Ian Hickson
89c1144718 Merge pull request #762 from Hixie/flex-bug
Reimplement 'stretch' for flexible items correctly.
2015-08-21 20:05:50 -07:00
Adam Barth
b61fe238f5 Rename syncFields to syncConstructorArguments 2015-08-21 17:21:42 -07:00
Adam Barth
dc7137b0ba Merge pull request #763 from abarth/scroll_gravity
Cleanup how we manage scrollOffset in Scrollable
2015-08-21 17:06:13 -07:00
Adam Barth
d3eaff2765 Cleanup how we manage scrollOffset in Scrollable
- Introduce _setScrollOffset as a backend for the animations so that scrollTo
   can stop animations.

 - Create a single function that stops both kinds of scroll animations.

 - Refactor how we update the bounds for bounded scroll behaviors so that we
   update the bounds and compute the new scroll offset at the same time.
2015-08-21 17:05:29 -07:00
Hixie
d81ec90c5f Reimplement 'stretch' for flexible items correctly.
Fixes #698 to actually work.
Also, adds some debugging aids around Flex.
And a test to check this fix.
2015-08-21 16:47:44 -07:00
Collin Jackson
ca42e8865d Merge pull request #747 from collinjackson/fitness_loading
Don’t flash a message while fitness data is loading
2015-08-21 16:21:05 -07:00
Adam Barth
010589be9e Rename all the scrollable classes
Block -> BlockBody
ScrollableBlock -> Block
FixedHeightScrollable -> ScrollableWidgetList
VariableHeightScrollable -> ScrollableMixedWidgetList
BlockViewport -> MixedViewport
2015-08-21 14:39:41 -07:00
Adam Barth
546a3acf0e Add missing file 2015-08-21 12:59:38 -07:00
Adam Barth
51c7194075 Add SetRequestedOrientation to Activity service
Fixes #743
2015-08-21 12:49:49 -07:00
Collin Jackson
d75fb40585 Don’t flash a message while fitness data is loading 2015-08-21 11:19:26 -07:00
Adam Barth
e95aee2715 Add the ability to draw borders on circles
We now support uniform borders on circular box decorations.

Fixes #741
2015-08-21 10:48:28 -07:00
Adam Barth
ac7c3a00fa Migrate RenderBox tests to box_test.dart 2015-08-21 10:18:48 -07:00
Adam Barth
855b8eb225 Merge pull request #740 from abarth/migrate_more_tests
Migrate sky/tests/layout to sky/unit/test
2015-08-21 10:02:38 -07:00
Adam Barth
ccd00bc5c2 Migrate sky/tests/layout to sky/unit/test
Also, I've organized the tests by the render object they're testing.
2015-08-21 10:01:58 -07:00
Ian Fischer
ce877f0926 Merge pull request #719 from iansf/add_listen_command
Add listen command to sky_tool, and related changes.
2015-08-21 09:54:04 -07:00
Ian Fischer
96c5d075aa Make sky_tool install to ios devices and simulators if available, and add a ‘listen’ command that will listen to filesystem changes in the current directory and update running versions of the app.
Also refactors ios_sim.py to be part of sky_tool.

The current skyx file that ‘listen’ generates does not contain material design icons, so icons will be missing.
2015-08-21 09:53:35 -07:00
Adam Barth
c7f528dab8 Migrate some tests to sky/unit/test 2015-08-21 09:13:52 -07:00
Adam Barth
b64e1aaba8 Introduce sky/unit/test
This patch adds a new test harness and a first, trivial test to run with the
harness. The new test harness is built on package:test and should run on
Travis. Over time, we'll migrate our existing tests into this harness.
2015-08-20 21:01:13 -07:00
Collin Jackson
1c06ea17a3 Fix #721 Dialogs should appear in place rather than animating in from bottom 2015-08-20 17:04:13 -07:00
Hixie
dda253bb29 Reorder bootstrapping code in rendering/ for slightly cleaner code. 2015-08-20 15:31:10 -07:00
Hixie
cf03afcd67 Fix compile error on trunk. 2015-08-20 15:05:01 -07:00
Hixie
79a9e670a2 Rewrite the MultiChildRenderObjectWrapper syncing algorithm.
This also changes the way we insert nodes into a
MultiChildRenderObjectWrapper's renderObject, which fixes issue #626.
Now, instead of the slot being a renderObject, it's the Widget that
currently uses that renderObject. That way when the Widget changes
which renderObject to use, the siblings of that Widget in the same
child list don't have to be notified of the change.

I tested performance of the new algorithm vs the old algorithm using
the stocks demo at idle and the stocks demo scrolling steadily. The
data suggests the algorithms are roughly equivalent in performance.
2015-08-20 14:56:04 -07:00
Adam Barth
5de9b52b1d Rename Component._built to Component._child
Rationalizes this name with walkChildren.
2015-08-20 14:17:08 -07:00
Adam Barth
2db1f59c74 Remove Widget.removeChild
This function just calls remove(). Also, have Widget do the recursive remove
walk by calling walkChildren.
2015-08-20 13:59:02 -07:00
Collin Jackson
62e67957c9 Merge pull request #717 from collinjackson/indicator
Add goal weight indicator line to fitness chart
2015-08-20 12:32:50 -07:00
Hans Muller
66c292c801 Merge pull request #716 from HansMuller/drawer-bug
Workaround for Drawer.initState() fails

This is a hack to avoid #715

In theory, the navigator's state should be updated in the event handler that triggers opening the drawer. It's not obvious how to do this, since we only build the Drawer when it's supposed to be visible (and once we're building it's too late).
2015-08-20 11:54:41 -07:00
Collin Jackson
d77d7b4893 Add goal weight indicator line to fitness chart 2015-08-20 11:45:31 -07:00
Collin Jackson
1217f3b5e7 Merge pull request #713 from collinjackson/goalweight
Support for saving goal weight
2015-08-20 11:44:48 -07:00
Hans Muller
4fdb998208 Workaround for Drawer.initState() fails 2015-08-20 11:25:59 -07:00
Adam Barth
de966121c8 Merge pull request #714 from abarth/stack_squish
Stack squishes positioned elements near the edge
2015-08-20 11:25:35 -07:00
Adam Barth
d2ca2f264c Merge pull request #712 from abarth/rm_paint_frame
Remove RenderView.paintFrame
2015-08-20 11:25:12 -07:00
Adam Barth
077e75e87b Remove RenderView.paintFrame
We now use the repaint system to do all the painting. During initialization, we
set up a root layer that applies the device pixel ratio.

Fixes #706
2015-08-20 11:24:33 -07:00
Adam Barth
f7aa83238f Stack squishes positioned elements near the edge
When laying out positioned children inside a stack, we should give them
unbounded constraints because if they draw outside of the stack, we'll just
clip them.
2015-08-20 11:15:15 -07:00
Collin Jackson
3e3f6242e3 Support for goal weight saving 2015-08-20 11:02:00 -07:00
Collin Jackson
5829688125 Merge pull request #691 from collinjackson/settings_save
Add support for saving settings in fitness app
2015-08-20 10:57:31 -07:00
Collin Jackson
c890dde70a Split fitness app’s UserData into UserData and UserDataImpl 2015-08-20 10:54:48 -07:00
Adam Barth
8a3285b6c5 Split up paintChildWithPaint into paintChildWithOpacity and paintChildWithColorFilter
The compositor backends we're planning to use can't handle a general-purpose
paint layer and instead need lower-level operations.

Fixes #707
2015-08-20 10:28:23 -07:00
Adam Barth
01b88ccc55 Merge pull request #710 from abarth/const_key
Key should be const
2015-08-20 09:55:59 -07:00
Adam Barth
eb1b0333e9 Key should be const
For great constness.

Fixes #693
2015-08-20 09:50:51 -07:00
Adam Barth
a2e75eaed0 Rename vestiges of root
We now use the term `renderObject`.

Fixes #708
2015-08-20 09:24:17 -07:00
Hixie
654fc7346e Improvements for Layers logic
- Introduce some new Layer classes.
- Introduce paintChildWith* methods.
- Convert paint() methods to use paintChildWith* where appropriate.
- Fix paintBounds logic in Layer world.
- Introduce Layer.replaceWith(), so that it's clearer what's going on.
- Make RenderObjects have a ContainerLayer, not a PictureLayer.
- Introduce a PaintingContext.replacingLayer() constructor to highlight
  where we are creating a layer just to replace an older one.
- Rename some layer-related methods and fields for clarity:
   requiresCompositing -> hasLayer
   hasCompositedDescendant -> needsCompositing
   updateCompositing -> updateCompositingBits
   _needsCompositingUpdate -> _needsCompositingBitsUpdate
   markNeedsCompositingUpdate -> markNeedsCompositingBitsUpdate
- After updating compositing bits, if we find that the bit changed, we
  now call markNeedsPaint().
- Reorder markNeedsPaint() logic for clarity.
- Make flushPaint() start at the deepest node.
- Make _compositeChild() avoid repainting children with hasLayer that
  aren't dirty, instead it just reuses their existing layer.
- Made RenderView reuse the RenderObject layer instead of having its own.
- Made RenderView have hasLayer set to true.
- Add various asserts and comments.
2015-08-20 08:57:22 -07:00
Hans Muller
d662f7e6d2 Handle changes to scrollDirection in ScrollableList et al
Changed the pageable_list.dart example: tapping on the toolbar changes
the scroll direction. This exposed some problems:

- Scrollable.syncFields() didn't update scrollDirection
- Viewport updated its RenderObject fields in the wrong order
- FixedHeightScrollable scrollDirection changes didn't update the scrollBehavior

There may be similar problems with VariableHeightList and ScrollableViewport.
I will fix those in a separate CL.
2015-08-20 08:24:16 -07:00
Adam Barth
72807ef8ec Fix padding on infinite scrolling list
Rather than using a Padding widget to provide padding along the scrolling axis,
we now just figure the padding into where we draw the items. This patch fixes
an issue where we would remove the first topmost item in a scrollable list too
early because we thought it was already off screen.

Fixes #697
2015-08-19 18:05:02 -07:00
Hixie
87adaf3fe9 RenderObjectWrapper cleanup and new asserts.
- Clarify comment about RenderObjectWrapper.
- Assert that we never sync a RenderObjectWrapper with an instance of a different type.
- Assert that MultiChildRenderObjectWrapper subclasses always have multi-child RenderObjects.
- Assert that renderObject doesn't change identity when syncing.
- Make searchForOldNode() return void since the return value is ignored.
- Remove code that handled renderObject changing during sync.
2015-08-19 16:26:23 -07:00
Hixie
2c44ed0f01 Implement 'stretch' for flexible items. 2015-08-19 13:28:28 -07:00
Adam Barth
3784201b9f Rev pub package 2015-08-19 13:09:20 -07:00
Hans Muller
9de941db18 Merge pull request #695 from HansMuller/dismissable-drag-fling
Dismissable: correct handling of a drag that ends with a fling
2015-08-19 12:29:24 -07:00