This isn't quite perfect since we seem to do a second layout as the
activity switcher is brought up which is shifting down our
toolbar and making it bleed slightly below the Activity Switcher's
Task description bar. But at least we're the right color now.
R=abarth@chromium.org, abarth@google.com
Review URL: https://codereview.chromium.org/1209423008 .
Previously, if a subclass of FixedHeightScrollable didn't set itemCount,
everything would silently work except that you wouldn't actully be able to
scroll. This CL makes it harder to forget to provide the itemCount by making it
an abstract getter. Now the analyzer will flag it as missing in subclasses and
we'll throw an exception at runtime if you forget it.
R=ianh@google.com, tonyg@google.com
Review URL: https://codereview.chromium.org/1219933004 .
The initial fix was updating Image to NetworkImage, which is the new
name for the Widget that takes a URL to an image.
However, this exposed an underlying bug: slots given to
MultiChildRenderObjectWrapper children were not getting updated in the
initial build. Initially, we don't have a next sibling for any of the
children's roots, since we haven't yet synced anyone after the one
we're syncing. So we pass null. However, as soon as we build the next
one, the previous one now has an out of date slot: null means
"append", but it needs to be "insert before the newly inserted root of
the next child". So now we update the slot after each insertion.
This returned the spinning_mixed demo to its original state, but that
state was buggy: the image would expand to fit the button and push the
text out of the button. To resolve that, this patch changes how
RenderImage sizes an image that has no desired dimensions but has some
constraints that make it impossible to show the image at full size:
now, we try to maintain the aspect ratio and honour the constraints
all at the same time.
Also, if the constraints are tight we skip all that logic, because
it'd be a waste of time.
To help with the slot issue above, I needed to see the widget tree and
the render tree and compare them (to see where the nodes were getting
out of order), so I also extended Widget.toString() to dump a deep
tree of the widget hierarchy.
Also, while debugging all this I noticed we sometimes walk the tree
into nodes that are null, which causes crashes. So to avoid that I
added null-checks to certain walkChildren() functions.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1212943007.
This:
- Adds asserts all over the place to make sure things are working
right with respect to the parent pointer.
- Fixes the bugs those asserts uncovered. It turns out we were failing
to update the parent pointer in a couple of cases: when the child
hadn't changed (but the parent had), and when the node was replaced.
- Remove the operator[] nonsense in scaffold.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1218183009.
There were two problems:
1) We didn't update the demo's use of RenderImage when we switched RenderImage
to take a sky.Image rather than a URL.
2) Scheduling a layout no longer ensured a visual update, which meant we'd
never actually flushLayout unless something else ensured a visual update.
TBR=jackson@google.com
Review URL: https://codereview.chromium.org/1221273002.
This CL factors the skyx build logic out of sky/apk/rules.gni so that we can
build skyx bundles without building entire APKs. This change makes it possible
to build skyx bundles for all the examples (except game).
TBR=eseidel@google.com
Review URL: https://codereview.chromium.org/1222673003.
This CL adds a build-time flag for building skyx packages, which make our
example Sky applications work offline. We can't enable this flag by default yet
because our build bots lack a few Dart packages, but landing this flag will let
folks experiment with this feature locally.
TBR=eseidel@google.com
Review URL: https://codereview.chromium.org/1221203002.
Previously, RenderImage knew about image_cache and expected to work in terms of
URLs. Now RenderImage works directly with sky.Image and it's the job of the
widgets system to interact with the network cache.
At the widgets layer, I've factored this work into three parts:
1) A wrapper for RenderImage that works in terms of sky.Image.
2) A component that can deal with any sort of Future<sky.Image>.
3) A NetworkImage component that translates relative URLs into
Future<sky.Image> using the image_cache.
A future CL will add a peer to NetworkImage that gets Future<sky.Image>s from
an asset bundle.
R=ianh@google.com, jackson@google.com
Review URL: https://codereview.chromium.org/1218023013.
This entails:
- Making the baseline logic cache results.
- Making the baseline logic track who used its information.
- Making the baseline logic mark all ancestors up to whoever used
its information wheneven its node gets markNeedsLayout.
- Making RenderShrinkWrapWidth make its child respect the step width
and step height, rather than just sizing the child then snapping.
This is required to make the ink splashes render right on menus
that are snapped.
- Adding debugDescribeSettings() to RenderShrinkWrapWidth.
- Introducing a RenderBaseline class that offsets its child to a
certain baseline.
- Factoring out some common code from RenderBaseline and
RenderPositionedBox to RenderShiftedBox.
- Redoing all the menu layout logic.
BUG=
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1219113003.
Also:
- give users of Material who previously relied on Material's defaults
opinions about background colours
- reindent stock_row.dart
- import colors as colors in example/widgets/styled_text.dart, rather
than in global scope, for consistency with other files
- import typography as typograpyh in example/widgets/tabs.dart, rather
than in global scope, for consistency with other files
- make flat_button actually be transparent by not painting a
background, rather than painting 0x00000000. This is the what I
actually originally set out to do here.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1217293003.
I ran this and fixed some of the warnings flagged:
cd ~/dev/mojo/src/sky && find engine/core/painting sdk/example sdk/lib -type f -name '*.dart' | perl -nE 'chomp; local $/ = undef; open(FILE, $_); my $file = <FILE>; print $file; next if $file =~ /^part of/om; say "import \"$_\";"' > all.dart && shelldb analyze all.dart 2>&1 | grep -v 'sky/all.dart'
Then I loaded the affected examples and fixed any bugs I found from running them.
Major change to SDK:
- Fix RenderPadding to get a valid size when it has no child (it was
previously sizing itself too small by the padding amount).
Minor changes, mostly to examples:
- Fix the 'part of' lines in sky_shell_dart_controller_service_isolate
to match the library name given in main.dart.
- Remove unused imports in various places.
- Fix example/game/lib/texture.dart to use the new Rect creation APIs.
- Remove unused code in example/mine_digger/lib/main.dart.
- Fix example/raw/hello_world.dart to use the new Size.center API.
- Fix example/rendering/baseline.dart and
example/rendering/justify_content.dart to have readable text.
- Fix compile error in example/rendering/transform.dart.
- Extend the debugDoesMeetConstraints() method to print useful
information when it will be used to fire an assert.
- Remove a warning about abstract methods on RenderView that would for
some reason only sometimes get flagged by the analyzer.
R=abarth@chromium.org, jackson@google.com
Review URL: https://codereview.chromium.org/1215163003.
This script consumes a sky.yaml file and produces a bundle that contains the
listed material design assets as well as the snapshot binary. This script isn't
wired into the build system yet because we don't yet download the material
design icons using DEPS.
R=chinmaygarde@google.com, eseidel@google.com
Review URL: https://codereview.chromium.org/1220893002.