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
All Effen which can directly create a sky.Node are now derived from RenderNode. In contrast, Component now derives from the (now) base Node class which simply represents a position in the Effen hierarchy.
A fair amount of clean-up & refactoring went into this change, simplifying & unifying the "sync" logic between Element & Component as well as making the Component.didMount/didUnmount signals async WRT component building.
BUG=
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1009543008
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
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
This patch refactors Effen in advance of allowing a final transform step from Effen nodes to sky nodes. The central changes here are:
1) Effen nodes get a _parentNode pointer
2) The lifetime of effen nodes is
->_sync (0 to N times)
-> the first _sync() causes a _mount()
->_unmount
3) Node should expect to sync even when they are first inserted (in which case they sync against a prototypical empty node which their class must provide).
4) Subclasses now override _syncNode() no longer takes host & insertBefore (_mount does). In the one case that a node must be replaced without being unmounted (inside _syncInternal), the old node is inspected for it's sky position.
TBR=abarth
Review URL: https://codereview.chromium.org/996103008
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
Previously, we had a problem with this physics simulation not actually hitting
the edge of the box and causing the scrollable contents to fall back down. To
avoid that problem, we enforced a minimum velocity for the particle to ensure
that it always hit the edge of the box. However, when that min velocity kicked
in, the results were visually unappealing.
This CL fixes the underlying problem. The fix is to apply the impluse from
gravity after updating the particle's position. In that way, we slightly over
estimate the particle's position in every step of the simulation, ensuring that
we don't miss the edge of the box due to errors in our simulation. With this
change, we no longer need the min velocity hack.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1008423002
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
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
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
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
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
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
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
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