Commit graph

24391 commits

Author SHA1 Message Date
Rafael Weinstein 196fd752c4 Remove unused Effen/widgets component. This was erroneously committed with the initial commit
TBR=eseidel
BUG=

Review URL: https://codereview.chromium.org/983173003
2015-03-06 10:24:01 -08:00
Adam Barth 21012343aa The floating action button should have a shadow
This provokes a rendering bug in MojoShell but not in SkyShell.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/984793002
2015-03-05 17:56:15 -08:00
Eric Seidel 2a9c2c40bf Make stocksapp.dart almost pass the dart analyzer.
To test:
sky/tools/shelldb analyze sky/examples/stocks-fn/stocksapp.dart

It prints 600+ warnings about the "native" keyword, and after
this change only a couple warnings about missing library names
which I don't fully understand.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/987613002
2015-03-05 16:52:14 -08:00
Hixie 760a6502e0 fix the hang when clicking the drawer in the stocks app
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980043005
2015-03-05 15:46:21 -08:00
Adam Barth 169dea3270 Move animationgenerator.dart to sky/framework/animation/generator.dart
That's where it belongs.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/979283002
2015-03-05 11:40:35 -08:00
Adam Barth 55421096ec Move fn.dart into /sky/framework
It's awkward to work on fn.dart in the examples directory so this CL moves it
to /sky/framework. Also, I've merged the whole library into one file instead of
using the |part| mechanism. The whole thing isn't that big.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/987463002
2015-03-05 10:53:01 -08:00
Adam Barth c3aeac0ea1 Remove some more Sky examples that don't run
These examples don't work anymore and have been replaced with
color-chooser.sky.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/987443002
2015-03-05 10:52:29 -08:00
Adam Barth b23b62af59 Fix the drawer curve to match Android
This CL changes the duration of the drawer animation to match the values used
by the Android framework.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/976193002
2015-03-05 10:16:19 -08:00
Adam Barth bf2ff82576 Organize sky/framework a bit
- Removed out-of-date README.md
- Moved fling-curve into the animation directory because it's part of the
  animation behavior of the system.
- Moved view-configuration into the theme directory because it's a collection
  of constants similar in flavor to the colors and the shadows. Eventually
  we'll want to make the theme configurable and have these all together will
  hopefully make that easier.
- Moved dom-serializer into tests/resources because it is used only by tests.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980423002
2015-03-05 09:59:50 -08:00
Adam Barth 38ef054f95 Remove duplicate copy of animation/curves.dart in fn widgets
Instead, we can just use the existing animation/curves.dart file in the
framework.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/976373003
2015-03-05 09:59:22 -08:00
Adam Barth 65592c41cd Add constants for material colors and shadows
This CL removes the hard-coded colors and shadows from the fn widgets and
replaces them with compile-time constants. The color values are from the
material spec:

http://www.google.com/design/spec/style/color.html#color-color-palette

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/983733003
2015-03-05 09:58:23 -08:00
Adam Barth 1c73dfb952 Remove duplicate copy of fling-curve.dart in fn
Instead of duplicating fling-curve.dart in fn, we now share the existing copy
in sky/framework.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/976363003
2015-03-05 09:57:42 -08:00
Adam Barth 09538aed91 stocks and stocks-fn should share the stocks data
Previously, the two versions of this sample app had separate copies of the
stock data. This CL moves the common data to the common data directory so that
they can share. Also, I've switched the data files to be |dart| files rather
than |sky| files to make them easier to use from fn examples.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980953002
2015-03-05 09:56:51 -08:00
Adam Barth 7b1f56d8b2 Clean up examples directory
This CL removes a bunch of examples that don't actually work in the current
engine. I've also renamed example-element to custom-element and
example-scrollable to scrolling because the word "example" in the name is
redundant with the name of the directory.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980323003
2015-03-05 09:55:55 -08:00
Adam Barth 50c2f8837b Don't hardcode the list of events types in fn
This CL changes how events work in fn. Previously, event listeners were passed
in as constructor arguments. Now Nodes hold an |events| object, which contains
all the event registrations. When a Component renders, all its |events| are
copied onto the Node it produces. When an Element syncs, it walks its |events|
and adds them as event listeners on the underlying sky.Element.

The net result of this change is increased flexibility in how events are
registered. Now components don't need to enumerate all the possible events that
they support. Instead, the parent component can listen for whatever events it
likes.

Also, I've cleaned up the association between DrawerAnimation and Drawer. Now
the constructor for Drawer accepts an |animation| object and wires up its
internal event handlers itself instead of requiring the constructor to do all
the wiring.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/975863003
2015-03-05 08:00:24 -08:00
Adam Barth 3f34718465 Clean up some Dart idioms in fn
This CL adds license blocks and cleans up a number of Dart idioms in fn.
Specifically, I've marked several fields as |final| and used Map#putIfAbsent in
some appropriate places.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/973613004
2015-03-04 08:27:04 -08:00
Rafael Weinstein e5a51a3052 Update sky/examples/fn README.md 2015-03-03 21:26:25 -08:00
Adam Barth a7aea2ba1e Give the floating action button a slash effect
R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/970393002
2015-03-03 16:10:21 -08:00
Adam Barth 4677386498 fn-drawer sometimes doesn't tick closed
If there is jank, we might not get a frame time that's just after the last
frame, which means we'll stop generating animation frames before hitting 1.0
exactly.

In this CL, we introduce state to takeWhile to cancel the stream after emitting the
1.0.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/975153002
2015-03-03 15:45:52 -08:00
Rafael Weinstein 130124bd4a Remove box shadow on floating action button until ganesh fixes its bug
TBR=abarth

Review URL: https://codereview.chromium.org/975203002
2015-03-03 15:36:21 -08:00
Hixie 658f770723 fn: make menu items have material splashes also, by factoring out the splashes
TBR=raf

Review URL: https://codereview.chromium.org/974903005
2015-03-03 14:12:15 -08:00
Adam Barth 3c5df69a2b Implement a floating action button in fn
R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/975913002
2015-03-03 14:05:02 -08:00
Eric Seidel de7f8a9c2b Change fn-stocks to use a different color toolbar.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/973133002
2015-03-03 11:17:10 -08:00
Rafael Weinstein 202f99d71d Initial commit of Effen reactive framework experiment for Sky
This is just a proof of concept. If we like this direction, it will move out of the examples directory (likely re-written) and be committed in smaller pieces with unit tests and formal reviews.

TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/971183002
2015-03-02 20:55:02 -08:00
Adam Barth 6f92088fae Use double rather than float
double is a built-in type in Dart. float isn't...

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/968293003
2015-03-02 13:11:05 -08:00
Eric Seidel b9c8e71096 Add support for pressure on pointer events
The touch demo needs some basic smoothing, right now
it looks rather jittery after this change.  But the pressure
code is definitely working!

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/970493003
2015-03-02 12:38:29 -08:00
Adam Barth 11c76c9c45 Make shake-to-reload actually work
We need to create a new service provider when we navigate to a new page
otherwise the new page is sad that the old page took its service provider.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962383003
2015-02-27 16:38:40 -08:00
Adam Barth 5db32b7186 Implement shake-to-reload
Apps can import this library if they wish to reload on shake.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/963303004
2015-02-27 15:31:11 -08:00
Adam Barth 5db8423f38 Expose Android sensors to via Mojo services
This CL adds a sensor_service to sky/services and wires it into SkyShell
The plan is to eventually use this data to implement shake-to-refresh.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962043002
2015-02-27 14:37:50 -08:00
Eric Seidel a128b09618 Fix multi-touch to work in SkyShell.
Before this patch it crashed.

Also updated the touch-demo to support multi-touch.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/961483004
2015-02-26 12:23:18 -08:00
Zachary Anderson 1a9b6b68d4 Dart: Renames dart:mojo_blah -> mojo:blah
This improves consistency with the convention that the dart: scheme is
only for things from the Dart standard library.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/951783004
2015-02-25 14:29:41 -08:00
Adam Barth 6d64856134 Implement quantum ink splashes
These aren't 100% correct, but they look somewhat reasonable.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/954023002
2015-02-24 15:41:52 -08:00
Adam Barth b4385bcebe Make the stock app demo list view prettier
This CL makes the list view in the stocks app more consistent with the material
spec by using a colored circle instead of color-coding the percentage change.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/932103004
2015-02-24 15:41:35 -08:00
Adam Barth 8462f94f22 Add a shadow to the sky-drawer
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/950353003
2015-02-24 11:33:26 -08:00
Adam Barth 0c2621411d Make the stocks drawer look more realistic
The menu items don't quite make sense for this app, but they're closer in
visual styling.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951413002
2015-02-24 10:48:23 -08:00
Adam Barth 5f50e4b60f Factor sky-toolbar into a componet and use a proper material shadow
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/953903004
2015-02-24 10:47:01 -08:00
Adam Barth 3904a6c35b Update Sky widgets to have more material design
This CL updates the Sky widgets to be closer to the material design spec.
There's still a long way to go, but this CL is a start.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951823002
2015-02-23 23:59:57 -08:00
Adam Barth adf02a0dc5 Add a search and menu button to stocks app
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/956463002
2015-02-23 22:14:26 -08:00
Adam Barth b24baa7a2a Add <sky-icon> to access material design widgets
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/947383002
2015-02-23 17:26:19 -08:00
Eric Seidel 4ca655c963 Add a box-shadow to the app-bar per material design
Also made the background a MD color.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/951653004
2015-02-23 17:19:29 -08:00
Eric Seidel 71390b7ef1 Attempt to make the stocks example more more material-friendly.
http://www.google.com/design/spec/components/lists.html#lists-specs
http://www.google.com/design/spec/style/color.html#

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/930193004
2015-02-23 16:19:06 -08:00
Adam Barth 465de9a02f Remove outdated examples and framework pieces
None of this code runs in the current Sky. Some of it never ran.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951673003
2015-02-23 15:09:36 -08:00
Eric Seidel 377cd1bea7 Show the last sale price in the stocks app
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/953593002
2015-02-23 14:51:22 -08:00
Eric Seidel 457c78f742 Make the stocks app slightly prettier.
I removed the green background and added display
of percent change (which is random for now).
I also display a random assortment of stocks every time
instead of always the top 100.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/950073002
2015-02-23 13:09:40 -08:00
Eric Seidel e6a5e59e25 Wire in more-real stock data for stocks example.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/954513003
2015-02-23 12:52:17 -08:00
Adam Barth 545f6abb02 Morph "appish" example into a "stocks" app
We'll flesh this example out over time to demo a bunch of our widgets.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/954503002
2015-02-23 09:30:11 -08:00
Adam Barth 973cf80fb9 Port sky-drawer to Dart
Also, port the "appish" example to exercise the drawer.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/942413002
2015-02-23 08:30:58 -08:00
Adam Barth eb117c7326 Port Sky widgets demo to Dart
This CL updates sky-box, sky-button, sky-checkbox, sky-input, and sky-radio to
work in Dart. We don't have a data binding system yet, so there's a bit more
plumbing in the code.

This CL adds support for sky-element@attributes, which lets you specify which
attributes your element supports. We use this information to synthesize getters
and setters for those attributes and to dispatch to mumbleChanged methods when
the attributes change.

I've also wrapped the widgets demo itself in a sky-scrollable so the whole
thing scrolls.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/946813005
2015-02-23 08:30:36 -08:00
Adam Barth 01938c9551 Port sky-scrollable to Dart
This CL ports sky-scrollable to the new sky-element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/950603002
2015-02-21 09:56:22 -08:00
Adam Barth fba37a0398 Add a basic sky-element custom element
After this CL, you can use <sky-element> to describe custom elements. The
current iteration is very basic and is hardcoded to "example", but its a start.

This CL renames the |init| function to |_init| to prevent importers from
calling it directly. Also, we now pass the <script> element to |_init| to give
some context.

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

Review URL: https://codereview.chromium.org/950493003
2015-02-20 21:45:36 -08:00