59 Commits

Author SHA1 Message Date
Collin Jackson
d331a98c22 Support for selected menu items
R=ianh@google.com

Review URL: https://codereview.chromium.org/1226583005 .
2015-07-07 16:44:29 -07:00
Eric Seidel
00adca7710 Roll versions in preparation for deploying demos/packages
TBR=abarth@google.com

Review URL: https://codereview.chromium.org/1216053015 .
2015-07-07 16:23:57 -07:00
Eric Seidel
60b42fdb8f Make examples which do not yet support skyx still work in skyx mode.
R=abarth@chromium.org, abarth@google.com

Review URL: https://codereview.chromium.org/1227663003 .
2015-07-07 16:18:15 -07:00
Eric Seidel
589290add1 Deploy TaskDescription to the rest of our demos
R=abarth@chromium.org, abarth@google.com

Review URL: https://codereview.chromium.org/1218293017 .
2015-07-07 14:31:52 -07:00
Adam Barth
3f3b07ac50 Teach Stocks how to load data when run from a package
When run with a root bundle, the Stocks app now fetches its data from the
Internet.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1208053008 .
2015-07-07 14:15:34 -07:00
Eric Seidel
854745316a Make the TaskDescription background color match the ToolBar on Android
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 .
2015-07-07 13:56:06 -07:00
Adam Barth
72cfc2a052 SkyDemo should launch demos in their own windows
R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1214633008 .
2015-07-07 13:35:26 -07:00
Collin Jackson
515c055c8e Back button should kill interactive flex app
R=abarth@chromium.org, abarth@google.com

Review URL: https://codereview.chromium.org/1214073014.
2015-07-07 12:57:52 -07:00
Collin Jackson
01e776e317 Fix back button behavior when returning from settings screen
R=abarth@chromium.org, hixie

Review URL: https://codereview.chromium.org/1209423006.
2015-07-07 10:53:24 -07:00
Adam Barth
213ef6a43f Make interactive_flex and mine_digger work offline
From SkyDemo.apk.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1221143003 .
2015-07-07 10:43:23 -07:00
Adam Barth
9206d80ff9 Factor ScrollableList out of StockList
A ScrollableList seems like a generically useful widget.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1223863003 .
2015-07-07 10:02:56 -07:00
Adam Barth
fa7ec92c67 Make it harder to forget itemCount for FixedHeightScrollable
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 .
2015-07-07 08:44:29 -07:00
Viktor Lidholt
f156f04930 Adds better explosions, shield, and game over
Renames actions
Fixes smaller bug in particle systems

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1223543004.
2015-07-07 06:42:43 -07:00
Viktor Lidholt
bb8e267b82 Adds ActionSequence to sprites and improved explosions in game demo.
Adds ActionRemoveFromParent
Adds ActionCallFunction

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1224773003.
2015-07-07 00:39:55 -07:00
Adam Barth
61a12040ef Attempt to fix Android gn
TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1218283003.
2015-07-06 18:28:58 -07:00
Collin Jackson
b95ff0270b improve divider appearance in dark mode
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1212343011.
2015-07-06 18:05:16 -07:00
Collin Jackson
ed92b54f18 Back button should be able to close apps (issue 155)
R=abarth@chromium.org, abarth@google.com

Review URL: https://codereview.chromium.org/1213623008.
2015-07-06 18:01:04 -07:00
Adam Barth
8dd60a3c96 SkyDemo.apk should be able to launch Stocks offline
We now put stocks.skyx into the APK so that we can run it offline.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1216673011.
2015-07-06 17:53:41 -07:00
Hixie
3164520701 Fix spinning_mixed.dart, and resulting yak shave.
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.
2015-07-06 17:31:22 -07:00
Collin Jackson
4c353a6511 Refactor stateful parts of Component into StatefulComponent
R=abarth@chromium.org, abarth@google.com

Review URL: https://codereview.chromium.org/1217093005.
2015-07-06 17:09:25 -07:00
Adam Barth
6f19816eaf SkyDemo.apk should show thumbmails when offline
We now get the thumbnails from the root bundle when offline and otherwise fall
back to the network.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1212343009.
2015-07-06 16:32:22 -07:00
Adam Barth
b69a2e761b Make SkyDemo.apk start offline
Offline support isn't complete, but after this CL, SkyDemo.apk is able to start
and show some UI offline.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1225883002.
2015-07-06 16:17:04 -07:00
Collin Jackson
07d3108e86 Use red as floating action button color rather than accent color
R=ianh@google.com

Review URL: https://codereview.chromium.org/1222243007.
2015-07-06 16:04:42 -07:00
Adam Barth
d94e1d6255 Move home.dart into example/demo_launcher
This CL makes home.dart less of a special snowflake and instead makes it a peer
to the other Sky examples. As a result, we can add a sky.yaml file and embed
the thumbnail assets it needs into demo_launcher.skyx.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1215703010.
2015-07-06 14:49:03 -07:00
Hixie
00dd5d3e99 When syncing a child, we have to update the parent in all cases.
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.
2015-07-06 14:16:17 -07:00
Hans Muller
c06fc9580a Scrollable TabBar Version 0
TODO:
- Make fling-scrolling work
- Tune scrolling performance
- When a tab is selected, snap it to the center if possible

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1221673006.
2015-07-06 10:23:31 -07:00
Adam Barth
a090303909 Rename scheduleFrame/setBeginFrameCallback
These are now scheduleFrame/setFrameCallback. Also, update schduler.dart to not
poke at sky.window, which is now always null.

Fixes #178

R=ianh@google.com

Review URL: https://codereview.chromium.org/1214943005.
2015-07-06 09:56:56 -07:00
Collin Jackson
a6f809b3d6 Initial implementation of SnackBar
R=abarth@chromium.org, abarth@google.com

Review URL: https://codereview.chromium.org/1216613004.
2015-07-06 08:40:35 -07:00
Collin Jackson
88b6042846 Refactoring to support dark theme better
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1218153005.
2015-07-06 08:05:29 -07:00
Adam Barth
5d3b218a5a Fix interactive_flex demo
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.
2015-07-03 21:34:59 -07:00
Adam Barth
7de453e634 Add skyx packages for all the Sky demos (except game)
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.
2015-07-02 17:07:44 -07:00
Adam Barth
2e477f067e Add a flag for building skyx packages
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.
2015-07-02 16:41:35 -07:00
Viktor Lidholt
8647cbd743 Adds action classes
Refactors clamp function

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1215413002.
2015-07-01 15:36:06 -07:00
Adam Barth
70b8347fe1 Hoist knowledge of image_cache into widgets/basic.dart
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.
2015-07-01 14:41:45 -07:00
Eric Seidel
834fb17258 Add a sky media service to make it possible to play a sound.
I didn't exactly follow the android API, but pretty close.

Also started a java/common implementation for things like
DataPipeUtils. I only needed the ability to copy from a data
pipe to a file, so that's the only function we have so far.

Fixes https://github.com/domokit/mojo/issues/270

R=abarth@chromium.org, abarth@google.com

Review URL: https://codereview.chromium.org/1211913005.
2015-07-01 12:29:40 -07:00
Hixie
d79ea98da2 Make popup menus line up to their baseline per the Material spec.
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.
2015-07-01 12:24:45 -07:00
Adam Barth
839cc4cc72 Convert image_cache to using Futures rather than callbacks
Future<sky.Image> is easier to work with than a callback that provides an
image. It will also let us use other images sources that vend futures to
images.

R=jackson@google.com

Review URL: https://codereview.chromium.org/1216303005.
2015-07-01 12:15:48 -07:00
Hans Muller
aecdef8ac2 Add a TabNavigator to the Stocks demo
Changed FixedHeightScrollable so that if the list shrinks past the current scrollOffset, the scrollOffset is adjusted so that the last/only page of the list remains visible.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1216323002.
2015-06-30 17:08:14 -07:00
Viktor Lidholt
18f96cc4db Fixes broken game example
BUG=
R=abarth@chromium.org, chinmaygarde@google.com, ianh@google.com

Review URL: https://codereview.chromium.org/1219953002.
2015-06-30 14:54:01 -07:00
Hans Muller
28c753500a Gratuitous tabs example enhancement
Demo all three varieties of TabLabels in 3 different
TabNavigators. Use another TabNavigator to select
among the three Card-encapsulated demos.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217243005.
2015-06-30 12:59:51 -07:00
Hixie
1351488a17 Remove Material's opinion about background colours, since in fact the background colour varies dramatically with the kind of material involved.
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.
2015-06-30 12:48:04 -07:00
Hixie
998895d9b8 Random cleanup of various Dart things in our tree.
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.
2015-06-30 12:03:50 -07:00
Adam Barth
ecc5134416 Remove package:sky/framework
Please use package:sky/widgets instead.

R=ianh@google.com, eseidel@google.com

Review URL: https://codereview.chromium.org/1221883002.
2015-06-30 12:01:54 -07:00
Hixie
80d6a881ca Fix all the components to pick the right colours from the theme.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217573003.
2015-06-30 11:50:14 -07:00
Adam Barth
2f4e404f7f Build stocks.skyx
This CL teaches the build system how to create the stocks.skyx application
bundle. This bundle contains the stocks snapshot as well as the material design
assets needed by the stocks app to run offline.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1216273002.
2015-06-30 11:16:35 -07:00
Adam Barth
205ab9f778 Add a script for packaging Sky bundles
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.
2015-06-30 10:22:02 -07:00
Viktor Lidholt
652625a9fb Adds particle systems to sprites
Adds color sequence class
Refactors drawing of textures

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1216573009.
2015-06-29 18:08:28 -07:00
Hixie
3ab1bb13a9 Add a new item to the settings page to show off the switch widget.
R=abarth@chromium.org, jackson@google.com

Review URL: https://codereview.chromium.org/1214113006.
2015-06-29 16:57:57 -07:00
Collin Jackson
ef6ebb7e76 Support for background images on cards, style demo home
R=ianh@google.com, abarth, hixie

Review URL: https://codereview.chromium.org/1217623002.
2015-06-29 16:22:22 -07:00
Hixie
05aafdbdfd Very minor clean-up of stocks app main.dart.
TBR=abarth

Review URL: https://codereview.chromium.org/1217113002.
2015-06-29 15:58:17 -07:00