20087 Commits

Author SHA1 Message Date
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
Matt Perry
604c13d57f Fix test failures from my previous animation patch.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1216923008.
2015-07-01 19:02:24 -04: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
2462028288 Teach Icon to use an AssetBundle
Currently this asset bundle is based on the network, but soon we'll be able to
use a local asset bundle.

R=jackson@google.com

Review URL: https://codereview.chromium.org/1217593004.
2015-07-01 15:25: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
Matt Perry
08fce0e905 Baby steps towards an odeon-like animation system. First victim: Drawer.
This introduces an AnimationPerformance class, which is intended to manage an
animation (or its reverse), with the ability to manually control the timeline
or to apply a force to advance the animation with a diminishing speed.

I'm having trouble fitting the odeon model to Sky. Odeon has a lot of nice
properties, but fundamentally operates on UINodes, which contain all the
properties to be animated. Sky, on the other hand, has no such universal
properties. Instead, each Widget assembles itself how it sees fit.

So my current plan is to let AnimationPerformance own a generic set of
AnimatedVariables. You pass it a bag of things, say position and opacity, as
AnimatedVariables. It updates them based on the animation, and they each have
a way to build a widget based on their current state.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1211603003.
2015-07-01 16:38:20 -04: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
Adam Barth
f3410b4f51 Factor dart_init.cc out of dart_controller.cc
Also, remove the non-SkyView client of DartController to simplify the code
further.

R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1210253005.
2015-07-01 10:54:03 -07:00
Adam Barth
6bccd47edc Add a NetworkAssetBundle that is backed by the network
R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1217083009.
2015-07-01 10:53:23 -07:00
Adam Barth
c4dfe5c4ba Remove dead code from DartController
This code existed to service WebView, which no longer exists.

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

Review URL: https://codereview.chromium.org/1209033016.
2015-07-01 09:34:19 -07:00
Adam Barth
bcf33bc66b Add missing build dependencies
These dependencies will trigger a "gn check" violation in a future version of
gn.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1218173003.
2015-07-01 08:28:52 -07:00
Adam Barth
141b20d8a7 Remove remaining HTML elements
This CL also removes the HTML parser and the HTML import system.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1215103007.
2015-06-30 21:30:46 -07:00
Adam Barth
e4f70d536a Remove (almost all of) //sky/engine/web
This layer is no longer needed now that the new world is gone.

TBR=eseidel@google.com

Review URL: https://codereview.chromium.org/1210153009.
2015-06-30 20:14:20 -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
Adam Barth
c227179b56 Improve default behavior for sky_tool start
Previously we defaulted to main.dart, which was confusing. Now we default to
the current working directory, which is more understandable. As part of this
change, I've also changed the default location of main.dart to lib/main.dart,
which makes our current examples.

Fixes #274

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

Review URL: https://codereview.chromium.org/1215103006.
2015-06-30 16:14:13 -07:00
Adam Barth
aabc059e54 Forward the Observatory port in sky_tool
Fixes #275

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

Review URL: https://codereview.chromium.org/1216283003.
2015-06-30 15:35:30 -07:00
Chinmay Garde
4dc4727536 Make sure skyanalyzer uses absolute paths to construct url-mappings for
dartanalyzer

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1215883006.
2015-06-30 15:29:18 -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
Adam Barth
826956d14d Remove the ability to load ".sky" files
Please use ".dart" files instead.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1222483002.
2015-06-30 14:48:32 -07:00
Viktor Lidholt
7e38a80358 Updates sky_server has for Mac
BUG=
R=abarth@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1221893002.
2015-06-30 14:47:11 -07:00
Hixie
430e80e9ea Improve the padding and sizing of popup menus.
Note that this wildly breaks the vertical alignment of menu items, I'll fix that in a subsequent CL.
(It wasn't really working before either, but looked ok by pure luck.)

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1215613005.
2015-06-30 13:56:40 -07:00
Adam Barth
661906e733 Port remaining Sky tests to the new world
These tests now run in the DOM-less world.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1212163009.
2015-06-30 13:53:20 -07:00
Hans Muller
42490925a6 Fix tabs.dart test results
TBR=abarth

Review URL: https://codereview.chromium.org/1214413002.
2015-06-30 13:32:40 -07:00