Commit graph

16209 commits

Author SHA1 Message Date
Adam Barth 854f083f1b Clean up examples directory
1) Merge input example into widgets example
2) Move single-file, non-fn examples into a "raw" directory
3) Rename stocks-fn and widgets-fn to stocks and widgets

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1005393006
2015-03-26 14:32:40 -07:00
Adam Barth 20a4c66ade Move fakesky.dart from examples to benchmark/resources
It's not really an example of how to use Sky. It's a resource for benchmarking.

TBR=raf@chromium.org

Review URL: https://codereview.chromium.org/1030423002
2015-03-26 14:08:10 -07:00
Adam Barth 52d8ea0c23 Remove flights example
Flights is not longer a good example of something you can build wity Sky.
Restore the flights-app-pixel test and move the assets needed for the test into
the tests directory.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1034953003
2015-03-26 13:28:23 -07:00
Adam Barth 114ebbed96 Rev Mojo and Sky pub packages
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1038873005
2015-03-26 12:59:00 -07:00
Adam Barth d47ecb8bc5 Menu in StocksApp should dismiss when tapping elsewhere
When the StocksApp menu is showing, the user shouldn't be able to interact with
the rest of the app. Instead, taps outside the menu should dismiss the menu.

This CL makes that happen by adding a ModalOverlay on top of the app. We might
want to do something fancier in the future using event delegation, but this
works for now.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1031093002
2015-03-25 10:43:35 -07:00
Adam Barth 1718f196c0 Remove the |style| parameter to InkWell
There's no reason for InkWell to take a |style| parameter anymore. Clients can
simply use StyleNode instead.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1019443003
2015-03-25 10:41:38 -07:00
Adam Barth 08f2a275ad Menu in StocksApp should animate out
This CL teaches PopupMenu how to animate out as well as in. Also, I've changed
the PopupMenuItem animations to be driven from the PopupMenu itself, which
makes it easier to run the animation in reverse when closing the menu.

TBR=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1033913002
2015-03-25 10:40:29 -07:00
Adam Barth 0abd3c9ef3 Clean up stock_app.dart
This CL cleans up stock_app.dart to better separate concerns now that we have
StyleNode. Also, this CL introduces IconButton, which will grow to include an
ink effect in the future, and makes the background of the search bar white.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1007893005
2015-03-24 18:00:33 -07:00
Adam Barth e1e5d93861 Load data for StocksApp incrementally
Previously we would spend a lot of time during startup processing all 3k stocks
in the data set. This CL breaks the data up into 100 stock chunks and loads
them incrementally off the network. A future CL will switch to loading them on
demand.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1038533002
2015-03-24 14:58:42 -07:00
Viet-Trung Luu 94d55d4003 A crappy "netcat"-type example (in Dart).
It's especially crappy since it doesn't actually do much/any error
handling.

Use:
$ sky/tools/skydb start out/Debug \
  'sky/examples/terminal/index.sky?url=mojo:netcat?host=localhost%26port=80'

(Note: We don't have a resolver yet, so the host either has to be
"localhost" or an IPv4 address in the form N1.N2.N3.N4.)

R=erg@chromium.org

Review URL: https://codereview.chromium.org/1032743002
2015-03-24 13:49:13 -07:00
Viet-Trung Luu 0593b9f813 Fix the terminal example.
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1031933002
2015-03-24 13:00:55 -07:00
Adam Barth cf204971fb Let Dart code running in Sky add events to the trace timeline
This will let us form a wholistic picture of work done in the framework and in
the engine.

R=ojan@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1028243003
2015-03-23 14:48:06 -07:00
Adam Barth 37bd64b209 Update references to Mojo core and bindings
Build fix after recent Dart bindings refactoring.  Now that these libraries are
not included in the snapshot, we need to load them from the mojo package.

R=zra@google.com
TBR=zra@chromium.org

Review URL: https://codereview.chromium.org/1029683002
2015-03-23 13:22:38 -07:00
Adam Barth 7818b1c0bb Make it possible to construct a Stock directly
We were missing the ability to initialize one of the fields.

TBR=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1027293003
2015-03-23 11:23:48 -07:00
Adam Barth cc1c9cb9fc Load stocks data off the network
Instead of hard-coding the stock data in the Dart file, this CL moves the data
to a JSON file and loads that file over the network. This change improves load
time for the Stocks app from 3 seconds to 2 seconds.

Also, this CL removes shake-to-reload from the Stocks app because that also
slows down load time (due to the two module systems fighting each other).

R=rafaelw@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/1021723005
2015-03-23 09:59:50 -07:00
Eric Seidel 03a2006046 Copy all of dart_sky.dart's supporting files into package:sky
Also bumped package:sky's version in prep for publishing.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1024243002
2015-03-20 14:46:58 -07:00
Eric Seidel ea62fa7d72 Make the Sky pub package include our APK and teach sky_tool to install it
I'm not sure this is the final long-term solution, but works for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022193002
2015-03-20 14:35:14 -07:00
Eric Seidel 49a947a868 Unbreak the build by adding the sky tool
TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1021933004
2015-03-20 13:59:15 -07:00
Rafael Weinstein f15727a644 [Effen] Move README.md to correct directory
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/1024183002
2015-03-20 13:24:10 -07:00
Adam Barth ca74c312f7 Use StyleNode in StockMenu
StockMenu was creating a container for the sole purpose of applying style to
PopupMenu. Now we just use a StyleNode.

Also, I've reverted the change to make box-sizing default to border-box. It
turns out that CL wasn't effective because we didn't use the initialBoxSizing
function to initialize box sizing. I've made us use initialBoxSizing but switch
the default back to content-box because actually using border-box breaks a
bunch of stuff.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1024083003
2015-03-20 10:16:24 -07:00
Adam Barth f65ff7f4e5 Introduce Scaffold to Sky framework
This CL extracts a Scaffold component from StockApp. The Scaffold component
lets you create an "app-like" layout with an action bar, a drawer, etc.

R=ojan@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1027813002
2015-03-20 09:34:06 -07:00
Rafael Weinstein 7ff22a955c [Effen] add StyleNode
This patch adds a new (non-Render) StyleNode which takes two arguments: A (content) node, which it wraps and a Style object.

This allows for styles to be applied to Nodes which are constructed elsewhere (e.g. passed in as arguments).

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1027653002
2015-03-16 12:27:25 -07:00
Adam Barth 11155a2b72 Add a basic custom painting facility to Sky
This CL adds just enough custom painting to Sky to make
sky/examples/painting/circle.sky draw a circle. Over time, we should be able to
elaborate this system into something interesting and to make it actually work
in a reasonable way.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1017593005
2015-03-19 16:00:21 -07:00
Adam Barth 9d9d2d52c5 Improve Material ink effects
1) Factors InkWell out of Material so that components can use an ink well
   without needing the shadow/level machinery.

2) Makes the ink effect move at a different velocity once the tap has actually
   occurred, converging with the spec. We don't have the right speeds yet, but
   at least we're approaching the right shape.

3) To support (2), added a primaryPointer attribute to GestureEvents to let
   authors coorelate gesturetapdown events with later gesturetap events.

4) To support (2), modernized SplashAnimation to used AnimatedValue and friends.

5) Added more constants to view-configuration.dart that match Android.

I've also removed the cancelling of the ink effect on scroll. The proper way to
do that is to notice that someone in the event chain is listening for
scrollstart and delay the beginning of the ink effect for some period of time.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1019023003
2015-03-19 11:17:48 -07:00
Viet-Trung Luu 818df5f4c6 Make the terminal demo able (to try) to connect to anything.
(Using the query string from the URL.)

R=erg@chromium.org

Review URL: https://codereview.chromium.org/1019323002
2015-03-19 11:14:56 -07:00
Rafael Weinstein bd7603bdb0 Change how events are handled in Effen
This patch removes the mutable API to event handling (Nodes no longer have a events object with which to add listeners).

Instead, a new (non-Render) Node is introduced: EventTarget. This node represents a location in the Effen tree which can handle events as they bubble.

Note that this also changes the implementation to use event delegation (one set of listeners at the sky.document level) rather than direct listeners on leaf nodes.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1019633004
2015-03-15 12:33:30 -07:00
Adam Barth f6d53459aa Improve the openning animation for PopupMenu
We're now doing all of the elements of the popup menu entrance animation from
the material design spec, but our timing and curves might not be exactly right
yet. I haven't started on the exit animation.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1017193004
2015-03-18 15:21:48 -07:00
Eric Seidel d5a089fd40 Remove custom elements examples, they are no longer maintained
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022613002
2015-03-18 13:38:17 -07:00
Eric Seidel 5457347032 Update deploy and deploy_sdk for the new package: world.
Before this change Sky would hit 404s when trying to
load examples from domokit.github.io.

I also added a separate sky_home and updated the default
url to point to sky_home instead of home.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1016143002
2015-03-18 13:00:46 -07:00
Adam Barth 977ece7e55 Begin work on the PopupMenu entrance animation
This CL also refactors how animations work, particularly for the Drawer. I've
renamed DrawerAnimation to DrawerController and switched it from being an
Animation to having an Animation. I've also renamed Animation to AnimatedValue
to capture the idea that the class actually presents the value being animated.
Finally, I've factored AnimatedValueListener out of Drawer so that it can be
used by PopupMenuItem as well.

Finally, I've added a scheduleBuild convienence function to Component instead
of having to call setState(() {}), which has come up a couple times.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1016093002
2015-03-18 11:31:07 -07:00
Adam Barth 9d14551fb7 Add a menu to the stocks app
We should probably move this menu into a view for an individual stock, but for
now add it to the main stock screen.

R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1008003007
2015-03-17 19:21:36 -07:00
Adam Barth df9d48ac83 Make stocks-fn match the style for the Sky SDK
1) Add a pubspec.yaml.
2) Move all the code into a 'lib' directory.
3) Move the stock widgets out of the app's library.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1011023003
2015-03-17 15:08:53 -07:00
Viet-Trung Luu d4f28b311e Move services/files/*.mojom -> mojo/services/files/public/interfaces/.
Ditto for terminal_client.mojom, previously in examples/echo_terminal.

Fix the sky terminal example.

R=erg@chromium.org

Review URL: https://codereview.chromium.org/1013313002
2015-03-17 14:31:56 -07:00
Adam Barth 2442b5313f Add a basic popup menu widget
Currently this widget is demoed in widgets-fn, but I'll move it into stocks-fn
soon.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1017873002
2015-03-17 14:18:13 -07:00
Eric Seidel 697c735740 Make mojo and sky dart packages deployable
The packages produced from this CL were deployed
as v0.0.1:
https://pub.dartlang.org/packages/sky
https://pub.dartlang.org/packages/mojo

There is still no tool included with the sky
package due to pub's inability to run anything
other than Dart:
https://code.google.com/p/dart/issues/detail?id=22877

I'm likely just going to write a dart version
of my "sky" script. :(

R=ojan@chromium.org, abarth@chromium.org

Review URL: https://codereview.chromium.org/1015833002
2015-03-17 11:09:33 -07:00
Adam Barth de7f898442 Cleanup events related to material splashes
This CL is a warmup for using a more sophisticated gesture disambiguation.

1) Use gesturetap instead of click. We should probably remove click events
   because folks should use gesturetap to integrate with the gesture system.

2) Handle the case where you swipe the drawer during an animation. Previously
   we had an assert which triggered in some multitouch scenarios. We'll
   eventually move this over to gestureswipe.

3) Remove an extra container for ink splashes. There's no need to group all the
   ink splashes in a container. They can all just be children of the Material
   component itself. This structure is left over from when Material was a base
   class.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1013713005
2015-03-16 20:53:55 -07:00
Adam Barth 74cfcc4d39 Introduce sky/framework/theme/typography.dart
This CL adds typography information to the Sky theme. The values are from the
Material Design spec. I've also applied these values to the stocks app and the
various components.

We're not geting precisely the right typography in some cases because of
https://github.com/domokit/mojo/issues/65.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1006363004
2015-03-16 20:53:26 -07:00
Adam Barth 914d935903 Fix the alignment of the title in Stock app
The left edge of the title should be on the 72px vertical keyline according to
the Material Design spec.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1010443005
2015-03-16 13:44:10 -07:00
Adam Barth 394b1e53dd Rename Sky's Toolbar to ActionBar
This naming matches the naming in Material Design.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1010913002
2015-03-16 13:26:06 -07:00
Rafael Weinstein 4c2f2486cf Allow Effen Styles to be extendable
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1006053002
2015-03-13 14:08:24 -07:00
Adam Barth 51db28b81b Organize sky/framework/animation
This CL cleans up the sky/framework/animation as follows:

1) I've moved code that's used only by the custom elements framework into
   sky/framework/elements/animation. This code is based on AnimationDelegates
   rather than Streams.
2) Rename ScrollCurve to ScrollBehavior because it encapsulates more behavior
   than just a curve.
3) Make the Generator interface explicit and mark subclasses as actual
   subclasses.
4) Move Simulation into generators.dart because it implements the Generator
   interface.
5) Move Animation out of generators.dart because it does not implement the
   Generator interface.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1001373002
2015-03-13 10:04:56 -07:00
Rafael Weinstein 77da542715 Update README.md 2015-03-12 20:36:24 -07:00
Rafael Weinstein 2d0f67afb5 Update README.md 2015-03-12 20:34:06 -07:00
Rafael Weinstein 93e9d5f796 Update README.md 2015-03-12 20:32:10 -07:00
Adam Barth f4872cdd67 Implement an OverscrollCurve for Scrollable
When using OverscrollCurve, we continue to scroll beyond the top of the
scrollable area but the scroll delta is reduced by 2x. A future CL will add an
animation at gesturescrollend to relax back to scroll position 0.0.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1002953003
2015-03-12 13:08:44 -07:00
Adam Barth a3885659c5 Factor ScrollCurve out of Scrollable
Intead of hard-coding the notion of bounded scrolling into Scrollable, this CL
factors out a ScrollCurve class that applies the bounds. In the future, we'll
refine this mechanism to implement overflow scrolling.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1005633002
2015-03-12 10:36:09 -07:00
Adam Barth d8fe727434 Fix errors in Sky detected by Dart analyzer
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1000863002
2015-03-11 22:04:22 -07:00
Viet-Trung Luu 0beafd3555 Terminal: Add support for (and "fix") backspace.
Also:
* Fix consecutive spaces (don't collapse them).
* Add support for ^L.

Still doesn't work:
* Totally blank lines. (I know why, but I don't know why I can't seem to
  fix it.)

R=erg@chromium.org

Review URL: https://codereview.chromium.org/997873004
2015-03-11 16:54:17 -07:00
Viet-Trung Luu d34e0e4e7c Fix terminal since sky-* moved.
D'oh.

TBR=erg@chromium.org

Review URL: https://codereview.chromium.org/998103002
2015-03-11 14:58:36 -07:00
Viet-Trung Luu a87e8d9db1 Add a simple prototype "terminal" example.
(Together with an app that echoes stuff from the terminal.)

R=erg@chromium.org

Review URL: https://codereview.chromium.org/999193002
2015-03-11 14:34:25 -07:00