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
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
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
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
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
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
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
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 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
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
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
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
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