When the StocksApp menu is showing, the user shouldn't be able to interact with
the rest of the app. Instead, taps outside the menu should dismiss the menu.
This CL makes that happen by adding a ModalOverlay on top of the app. We might
want to do something fancier in the future using event delegation, but this
works for now.
R=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/1031093002
Most of the elements that want to be Material (i.e., have a level and cast a
shadow) don't want to be InkWells (i.e., have an ink splash effect). This CL
disentangles these two components, fixing bugs in the Drawer and in the
PopupMenu. Separating these concepts also lets us use Material for the
ActionBar and the FloatingActionButton.
R=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/1037673002
This CL uses CSS transition to add an implicit animation between purple
ActionBar and the light grey "search" action bar. It's unclear to me how best
to create implicit animations in this system, but using a CSS transition works
surprisingly well.
Also, fix the typography style for the placeholder in the search box.
Previously it was white on Grey[50], which was extremely hard to see.
R=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/1036783002
This CL teaches PopupMenu how to animate out as well as in. Also, I've changed
the PopupMenuItem animations to be driven from the PopupMenu itself, which
makes it easier to run the animation in reverse when closing the menu.
TBR=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/1033913002
This CL cleans up stock_app.dart to better separate concerns now that we have
StyleNode. Also, this CL introduces IconButton, which will grow to include an
ink effect in the future, and makes the background of the search bar white.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/1007893005
The bindings, core, and application libraries are now referred to as, e.g.:
package:mojo/public/dart/core.dart
Since the handle watcher remains in the snapshot, it no
longer refers to types defined in core.dart. References to types defined
in core.dart are also removed from mojo_natives.cc.
In Dart packaged apps, the SDK is zipped up under mojo/public/dart.
For embedder tests, the SDK is copied into the generated source output directory.
A base_dir parameter is added to the 'dart_package' and 'mojom' GN macros so that
consumers of the Mojo SDK can all import using the same URIs regardless of where
the SDK lives in their source trees.
BUG=
R=erg@chromium.org
Review URL: https://codereview.chromium.org/1027603002
Instead of hard-coding the stock data in the Dart file, this CL moves the data
to a JSON file and loads that file over the network. This change improves load
time for the Stocks app from 3 seconds to 2 seconds.
Also, this CL removes shake-to-reload from the Stocks app because that also
slows down load time (due to the two module systems fighting each other).
R=rafaelw@chromium.org, ojan@chromium.org
Review URL: https://codereview.chromium.org/1021723005
This patch adds an assert that the mount/unmount queues are not subject to concurrent modification and refactors the sync-tracing to avoid the cost of string interpolation if tracing is disabled.
BUG=
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1020103004
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 patch adds a base AnimatedComponent from which most components that animated should derive. It takes care of listening & unlistening from the animations during did(Un)mount as well as binding the animated value to a private field and scheduling the component for build.
Note that this patch removes the did(Un)mount overridable methods from Component and replaces them with a callback mechanism which is less brittle.
BUG=
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1027633003
A recent change caused my scrolling app to fail because
didMount() was no longer called on my Scrollable subclass
at startup time.
I haven't been able to sort out how this used to work.
This CL is a hack to make it work again.
R=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/1019973003
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
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