2173 Commits

Author SHA1 Message Date
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
Eric Seidel
63cefd8bc1 Use sky_shell instead of mojo_shell for testing.
This does way more than a single CL should do, sorry.
- Fixed a bunch of logging/error reporting during loads.
- Made it possible for --package-root to be absolute.
- Fixed (hypothetically) parts of iOS build to be clang-plugin-compliant.
- Made all tests pass in sky_shell
- Removed a bunch of layout_tests including windows support.

I'll remove all the mojo test harness stuff in a follow-up patch.

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

Review URL: https://codereview.chromium.org/1215953006.
2015-07-06 17:45:49 -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
749bd906db Set the default whitespace mode to pre-wrap
This CL makes it easier to insert line breaks into text runs.

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

Review URL: https://codereview.chromium.org/1221913003.
2015-07-06 15:44:54 -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
2fdb5b3d9c Scrollable TabBar Version 1 - support for flinging
As far as I can tell, Material TabBars are not supposed
to overscroll/bounce. The new TabBarScrollBehavior
class supports fling, but it doesn't overscroll/bounce.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1215713009.
2015-07-06 13:52:37 -07:00
Matt Perry
ba2fb3cf31 Fix regressions with Drawer animations that I introduced.
- The drawer mask was too dark.
- The drawer didn't track the user's finger when dragging.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1220973005.
2015-07-06 16:46:02 -04:00
John McCutchan
edbb38a586 Add mojo_services pub dependency from sky sdk
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1224623007.
2015-07-06 13:31:23 -07:00
Hixie
05aae0ce69 Trivial parts of https://codereview.chromium.org/1218183009/ so that that patch isn't confused by variable renames.
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1222393002.
2015-07-06 13:25:13 -07:00
Hixie
a2d9ff60b9 Make the menu items in the drawer change colour when tapped, per Material spec.
This is done by the following steps:

- Make Inherited classes notify their descendants when their state
  changes.

- Make Components track which Inherited classes they looked at.

- Make Components handle being notified of state changes by rebuilding
  if the changed ancestor is of a type we've looked at.

- Refactor setState() and scheduleBuild().

- Make the "buildDirtyComponents" phase support incrementally building
  more components as each one finds it needs to update itself.

The way this works is that when the menu item updates its color, it
does so by changing a DefaultTextStyle (Inherited) node in its tree.
That node then notifies its ancestors, which include in particular the
Text component, which uses DefaultTextStyle. The notification is
received, and, even though we're already in the rebuild phase, the
Text queues itself up to be rebuilt as well. Since we now support
adding people to the rebuild phase while it's active, it gets rebuilt
as well, and all is well.

This CL depends on the fix in https://codereview.chromium.org/1218183009

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1222823004.
2015-07-06 13:17:23 -07:00
Adam Barth
3dd427d6f5 Update test expectations after view padding change
We no longer have view padding during testing so these values change a bit.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1225703003.
2015-07-06 12:40:19 -07:00
Adam Barth
8031ab6bd7 Add padding values to View.idl
Rather than hardcoding the size and presence of the notification area in Dart,
we now expose padding values on the view. These values are set to non-zero
values when there are UI elements that overlap the view. We currently respect
only the top padding, but this CL paves the way to respect padding in other
directions.

We still hardcode the size of the notification area in Java. A future CL will
retrieve this value from the Android framework.

Fixes #257

R=ianh@google.com

Review URL: https://codereview.chromium.org/1220353002.
2015-07-06 10:56:02 -07:00
Adam Barth
13dc6e2172 left + right mouse button causes dart exception
We should remove the state from our map only if the last button is going up.

Fixes #260

R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1215743003.
2015-07-06 10:44:11 -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
Benjamin Lerman
7600714a6f Do not use android specific API in mojo/java.
R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1217573005.
2015-07-06 14:56:14 +02:00
Adam Barth
2aaf77dc2e Remove sky/engine/platform/clipboard
No one references this code anymore.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1219833007.
2015-07-05 21:49:17 -07:00
Adam Barth
0e12b4d42c Delete sky/engine/core/fetch
No one references this code anymore.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1223793006.
2015-07-05 21:00:45 -07:00
Adam Barth
0e7ec746f9 Remove references into sky/engine/core/fetch
This CL removes all references to sky/engine/core/fetch from outside that
directory. All these references appear to be dead code. Also, remove a few
"loader" classes that were also dead code.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1214513003.
2015-07-05 20:03:45 -07:00
Adam Barth
df78625631 Remove support for loading remote font faces
This CL removes the ability to load remote font faces using CSS. This CL is
part of a series to remove the network dependency from Sky engine. We'll likely
add the ability to load custom fonts in the future, but we'll base the API on
mojo::DataPipe, similar to how we load images over mojo::DataPipes today.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1223843003.
2015-07-05 16:03:18 -07:00
Adam Barth
3dcd43c615 Remove RenderImage
This CL removes RenderImage and all the other remaining uses of ImageResource
from sky/engine/core/rendering.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1228463002.
2015-07-05 14:35:40 -07:00
Adam Barth
1a42846ab6 Remove CSS clients of ImageResource
This CL is part of a series to remove the network dependency from Sky Engine.
This CL removes the clients of ImageResource in sky/engine/core/css.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1214633005.
2015-07-05 13:19:32 -07:00
Adam Barth
05c71d86aa Remove sky/engine/core/app
This code is unused.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1223783002.
2015-07-05 13:19:03 -07:00
Tony Gentilcore
f372908e9a Make FloatingActionButton respect the onPressed ctor arg.
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1210923003.
2015-07-04 09:28:36 -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
b4b5b8e638 Make it possible to load Sky demos from local bundles
This CL teaches SkyDemo how to load Sky applications from local bundles. It
also teaches home.dart how to request a load from a bundle.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1213203008.
2015-07-02 16:43:09 -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
Adam Barth
25fc061387 SkyDemo should use explicit intents
This CL switches SkyDemo over to using explicit intents for deciding which Sky
apps to run. This change lets us get rid of the hacky "sky" URI scheme.
Instead, we use normal URLs but we require the sender of the intent to be
explicit in directing the VIEW intent to us.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1221123003.
2015-07-02 15:41:45 -07:00
Adam Barth
ec1f327121 Stocks.apk should have icons when run offline
This CL adds the concept of a root asset bundle to Sky. If the Sky app was
launched from a bundle, the root bundle is that bundle.

This CL teaches icon.dart to default to loading icons out of the root bundle,
if a root bundle exists. The next result is that Stocks has icons when run
offline because the icons are present in stock's skyx bundle.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1208273003.
2015-07-02 13:47:13 -07:00
Adam Barth
9ab6d395f3 Teach Stocks.apk how to load a skyx bundle
This CL teaches Stocks.apk how to start from a skyx bundle name |app.skyx| in
the APK's asset collection.

Stocks.apk still actually starts from |snapshot_blob.bin| because we can't yet
produce skyx files as part of the build process.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1221033006.
2015-07-02 13:09:57 -07:00
Adam Barth
36930f7ab7 Remove two unused functions from dart:sky.internals
These functions used to support testing, but they're no longer used by any
tests now that we've deleted the DOM-based world.

Really we should merge dart:sky.internals into dart:sky, but that's a CL for
another day.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1221163002.
2015-07-02 13:09:41 -07:00
Adam Barth
ae892ea9c8 Switch SkyShell to its own ResourceExtractor
This CL prepares us to have more interesting resources than base's
ResourceExtractor understands.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1221153002.
2015-07-02 11:24:57 -07:00
Adam Barth
2c6908f279 Rename ViewportObserver to SkyEngine
The term ViewportObserver doesn't mean anything. This interface has evolved to
control the engine. This new name reflects that.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1222663003.
2015-07-02 09:56:24 -07:00
Adam Barth
baf2807ee3 Port skyx to Dart
Rather than require Sky developers to have a Python environment, we should
write our tooling for Sky in Dart. This CL converts skyx.py into skyx.dart and
makes skyx.py into a wrapper for skyx.dart. We still need the Python wrapper
because gn requires that build actions are written in Python.

This code isn't wired into the main build yet. We'll need to add some more pub
packages to our buildbot environment first.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1213213003.
2015-07-02 09:12:39 -07:00
Adam Barth
31f8a9d910 Fix remaining analyzer warnings in Sky
TBR=ianh@google.com,mpcomplete@google.com

Review URL: https://codereview.chromium.org/1213573006.
2015-07-02 08:49:08 -07:00
Adam Barth
01f69396d5 Fix some dart analyzer warnings.
R=ianh@google.com

Review URL: https://codereview.chromium.org/1212013004.
2015-07-02 08:08:48 -07:00
Adam Barth
8ef6902c51 Fix a bug found by the analyzer
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1221023002.
2015-07-01 16:10:23 -07:00