26 Commits

Author SHA1 Message Date
Adam Barth
4d6063101b 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
Adam Barth
28d09890e3 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
a2904c14d3 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
cf1f36f69e 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
f867498266 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
Adam Barth
6eb32909c4 Fix some checked mode errors in drawer.dart
We need to use the more generic type Curve. Also, added an assert to catch this
earlier.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1017463002
2015-03-16 12:56:18 -07:00
Adam Barth
be7eb7fbfa Make the status bar translucent
This CL lets Sky apps draw behind the Android status bar, better matching the
material design spec.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1010493007
2015-03-16 11:14:04 -07:00
Adam Barth
9cae912b49 Make Sky's drawer match Material Design spec
This CL makes the drawer the correct size and use the correct animation curve.
Also, remove the hard-coded z-index values now that hit testing works again.
This CL adjusts the mask's opacity to match the drawer in Gmail.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1012463003
2015-03-16 10:16:45 -07:00
Eric Seidel
8ad5f14611 Currently we use package: to mean "/gen", which is not at all how
Dart actually expects package: to work.  This CL makes package:foo
map to /packages/foo, similar to how Dartium or bin/dart would expect.

This also means overlaying the /gen directory over the actual package
outputs (as consumers of an SDK would expect) as well as adding
an additional /lib indirection for the actual package source as
the Dart pub tool will expect.

This is far from perfect, but it unlocks us actually producing a
sky SDK.

I expect there may be some fallout from this change as I'm sure I
missed some package: uses.  We also don't have a general solution
for all /foo/bar/baz includes which randomly included parts
of mojo's source directory.  Those will need to be updated to use
a package: and deploy_sdk.py taught how to build a package for them.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/990493002
2015-03-13 16:58:53 -07:00
Adam Barth
85d02799fd Improve Sky's Scrollable physics
We now use a physics simulationt to drive the scroll fling. We're also closer
to integrating fling into overscroll.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1004363002
2015-03-13 15:57:41 -07:00
Rafael Weinstein
0765e85bf5 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
1eb13d0112 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
Adam Barth
06bfddff81 Drive overscroll animations with a physics simulation
This CL uses a simple physics simulation to drive overscroll animations.
We model settling the overscroll as a particle climbing a hill, which
gives us a pleasing parabolic trajectory.

This CL also includes machinery for spring-based simulations. We'll use
these to drive the drawer animation.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/999423004
2015-03-13 09:31:10 -07:00
Adam Barth
70aa7795c7 Scrollable should settle back to 0.0
This CL teaches Scrollable how to settle back to a scroll offset of 0.0 after a
fling or a scroll. There's still some room for improvement:

1) Some of this logic should be factored out into the scroll curve object.
2) We don't produce the correct animation curves when we fling into the
   overscroll region because we wait for the fling velocity to reach zero
   before we start the settling animation.

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

Review URL: https://codereview.chromium.org/1005753002
2015-03-12 14:33:37 -07:00
Adam Barth
52d2d67754 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
7cb9edebe1 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
e39868357a Factor a Scrollable base class out of FixedHeightScrollable
This class encapsulates the scrolling behavior but not the mechanism for
building the visual components.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1006533002
2015-03-12 10:10:04 -07:00
Adam Barth
111a25a569 Rename fling-curve.dart to fling_curve.dart
We're using underscores as word separators per Dart style.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/998373002
2015-03-12 09:40:43 -07:00
Adam Barth
deb2f1b757 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
Adam Barth
24a53815a0 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
Adam Barth
907231aad1 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
35322ed08b 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
8c4edc7374 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
457da82302 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
4fa137f50d 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
b3d20fac21 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