Commit graph

16535 commits

Author SHA1 Message Date
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
Adam Barth 6d7725b3b2 Update Button to be made of Material
To accomplish this, I made the following changes:

1) Material is now in charge of drawing the material shadows.
2) In order to mix in the style for the shadow, Element now takes a list of
   Styles instead of a single style.
3) Update all clients of Element#style to understand that we now have a list.
4) Update components that drawer shadows to have Material do that work instead.
   a) One exception: FloatingActionButton draws its own shadow because of its
      crazy clip requirements. We'll probably want to find a better way for
      FloatingActionButton to clip in the future.

I've also added a widgets-fn example to demo the fn material widgets.

This CL introduces a bug into Drawer whereby you can get ink splashes
everywhere in the drawer. In the future, we'll need to separate out the
different material aspects to get non-splashable materials.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1003553002
2015-03-11 14:20:11 -07:00
Eric Seidel 6987f50834 Move sky-*.sky into framework/elements
We're not actively developing these at the moment.

I could also just delete them, not sure if we're ready for that yet.

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/999873002
2015-03-11 13:50:09 -07:00
Adam Barth b5b7ddac27 Make Stocks app search actually search
We don't yet reset the scroll offset, so sometimes you can't see your search
results properly.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1002453003
2015-03-11 12:07:24 -07:00
Adam Barth bc6fb30f01 Add placeholder text to the Input component
R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/996213004
2015-03-11 11:30:28 -07:00
Adam Barth c62170006f Re-work MaterialComponent
Instead of MaterialComponent being a base class, components that want material
behavior simply create a MaterialComponent during their render function. This
approach gives the component more flexibility as to its structure and gives
MaterialComponent more flexibility has to how the components it generates are
related to the existing children.

Also, I've improved some of the event delegation code. There's no reason to
attach event handlers to the root component you emit during |render| because
the framework already delegates events from your root component to you.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/983903003
2015-03-11 10:17:54 -07:00
Adam Barth ceddf0e5f1 Make the search box in the stocks app show a search field
The search field doesn't do anything, but it's there.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/998803002
2015-03-10 17:17:03 -07:00
Adam Barth 5d27d7b223 Move example fn widgets into sky/framework/components
Moving these files into sky/framework will make them easier to use from the
SDK. Also, this CL also splits up the giant "widgets" library into smaller
libraries, one per component.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/993033003
2015-03-10 15:55:24 -07:00
Adam Barth 0f99e272d8 Move material Input component into sky/framework
The implementation details are in sky/framework/editing.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/983213005
2015-03-10 15:03:10 -07:00
Adam Barth a04c6b09ef Make a material design Input component
We don't yet have a focus controller, which means once this control becomes
focused there's no way for it to lose focus.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/999553002
2015-03-10 14:58:12 -07:00
Eric Seidel 7e9bbbec21 Sort the stocks displayed in stocks-fn as per Material Design
http://www.google.com/design/spec/components/lists.html#lists-behavior

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/993093004
2015-03-10 14:55:49 -07:00
Eric Seidel a8891ed07e Fix toolbar height to match Material Design.
54px on small screens:
http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/995133002
2015-03-10 14:38:44 -07:00
Adam Barth 6f691a043e Make Sky's EditableText mostly work
This CL factors EditableString out of EditableText and implements more of the
InputConnection functions. As a result, EditableText now basically works.

This CL also paves the way to make EditableText stateless by using
EditableString as its state object. However, there's still a bit more work to
do to make that a reality (e.g., factoring out the cursor blink timer and the
connection to the keyboard).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/995073002
2015-03-10 12:31:55 -07:00
Rafael Weinstein f7cdfda454 Add initialDelay to AnimationGenerator and add Animation class.
This patch allows for an initial delay before an animation begins and also adds an Animation class which encapsulates a value which is long-lived, can be explicitly set and also animated from its current value to another value.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/994143002
2015-03-10 12:22:15 -07:00
Adam Barth 42b7a2716d Implement a basic IME-aware input element
This CL introduces a new keyboard service that understands Android IME and
starts work on a Input component that interacts with this service to provide an
editing control.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/995613002
2015-03-09 16:19:56 -07:00
Rafael Weinstein 409b12e5df Change the name of Component.render to Component.build in Effen.
"Render" is misleading. "Build" may not be the best word either, it's closer to what's actually happening.

R=ojan@chromium.org
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/992033002
2015-03-09 13:30:13 -07:00
Rafael Weinstein b7d9e4753f Ensure that sky Nodes are in the document when didMount() is fired. Refactor FixedHeightScrollable to inspect heights rather than having the passed in
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/994553003
2015-03-09 12:39:10 -07:00
Rafael Weinstein 440185f854 add some more sky api to fakesky stub implementation.
TBR=eseidel
BUG=

Review URL: https://codereview.chromium.org/987833002
2015-03-06 12:46:02 -08:00
Rafael Weinstein 4dcb64a99f Effen: willUmount->didUnmount, allow setState after didUnmount
This patch changes the timing of the unmount call until after the component is removed (and marked as such) and allows setState to be called after this point. If this happens, setState will still invoke the closer to do any neccesary cleanup, but doesn't schedule the component for render

R=eseidel@chromium.org, eseidel
BUG=

Review URL: https://codereview.chromium.org/985853002
2015-03-06 12:23:53 -08:00
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