192 Commits

Author SHA1 Message Date
Adam Barth
2bd4e5bd81 Remove fn.md
The fn1 framework is deprecated. We don't need docs for it anymore.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1189323002.
2015-06-18 22:29:04 -07:00
Hixie
ee4a7bc925 Rename editing2/ and theme2/ to editing/ and theme/.
Flesh out a README.md file for the SDK.
Make the stocks app test wait for the app to be mounted, to catch some more errors, like typos in the mount callback.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182053012.
2015-06-18 12:44:10 -07:00
Adam Barth
d6cbdb4081 Fix data loading in the stocks app
We can't have two copies of |embedder.dart| or |shell.dart| because they take
ownership of some underlying Mojo handles. Instead of duplicating the code,
this CL makes the old locations just export all the symbols from the new
location. I've also done the same with fetch.dart to avoid code duplication.

Finally, I've removed image_cache.dart in the old location because the only
clients already live in the new world and ought to use the new location.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1179923004.
2015-06-18 09:14:51 -07:00
Hixie
3110059915 Cleanup of SkyBinding, and resultant yak shaving.
Some files are moved by this:
  Copy framework/node.dart into types/ - preparing for framework/'s decomissioning.
  Move app/scheduler.dart into sky/scheduler.dart - "app" doesn't really make sense.

As part of the SkyBinding cleanup, I made the hit-testing less
RenderBox-specific, by having the HitTestEntry.target member be a
HitTestTarget, which is an interface with the handleEvent() function,
which is then implemented by RenderBox. In theory, someone could now
extend hit testing from the RenderBox world into their own tree of
nodes, and take part in all the same dispatch logic automatically.

This involved moving all the hit testing type definitions into a new
sky/hittest.dart file.

Renamed SkyBinding._app to SkyBinding._instance for clarity.

Moved code around in SkyBinding so that related things are together.

Made WidgetSkyBinding use the existing SkyBinding.instance singleton
logic rather than having its own copy.

I also added some stub README.md files that describe dependencies.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1187393002.
2015-06-17 19:54:11 -07:00
Hixie
c6f0b8447d Fork some more files from the old framework, so that the transition will be easier to perform.
Summary:
  framework/animation/* -> animation/*
  framework/debug/utils.dart -> debug/utils.dart
  framework/shell.dart -> mojo/shell.dart
  framework/embedder.dart -> mojo/embedder.dart
  framework/net/* -> mojo/net/*

This should have no code changes except fixing and reordering imports.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1189943004.
2015-06-17 19:09:28 -07:00
Adam Barth
c4a7aa33d5 Delete sky-element framework
This framework is two generations old and has no clients.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1177843010.
2015-06-17 10:05:04 -07:00
Adam Barth
5e5b220f8f Fix two minor issues with sky/sdk
1) BUILD.gn was missing internals.dart.
2) generators.dart was importing scheduler.dart from the wrong directory.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1189523003.
2015-06-15 01:10:12 -07:00
Adam Barth
219ead3718 Rename all the things
This CL moves the bulk of the SkyView code out of the |framework| directory
because the |framework| directory was redundant in Dart package import
declarations.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1177383006.
2015-06-13 09:46:52 -07:00
Adam Barth
2811c03484 Rename widgets/wrappers.dart to widgets/basic.dart
Although the basic widgets are wrappers, that's an implementation detail and
shouldn't be encoded in the name of the library.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1182983002.
2015-06-12 22:16:48 -07:00
Hixie
9fc0a3f2ae Verify that callers correctly set parentUsesSize if they use the child's size (and fix a few cases that didn't).
This introduces a bunch of code that should only run in debug builds, but we don't have #ifdefs yet.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182933003.
2015-06-12 17:09:57 -07:00
Adam Barth
d59f88b826 Port sky_home to the new SkyView world
R=ianh@google.com, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1178293004.
2015-06-12 16:53:29 -07:00
Hixie
17e6849273 Make it easier to debug examples/widgets/container.dart, since it is currently showing a crazy clipping/transform bug.
TBR=abarth

Review URL: https://codereview.chromium.org/1186653003.
2015-06-12 15:17:33 -07:00
Eric Seidel
a300cb7770 Use drawable_xxhdpi instead of 2x_web
This makes the icons look nicer on the Nexus 5

I briefly played with trying to figure out which drawable_*
to use dynamically, but I couldn't seem to write a reasonable
solution which worked on both Desktop and my Nexus 5, leading
me to believe I didn't understand how it should work and just
went with xxhdpi for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1186633003.
2015-06-12 13:50:03 -07:00
Hixie
be5a2f8bc5 Fixes tests, logic, and analyzer warnings due to recent checkins.
- Fix the expectations file for stocks, since floating action button changed how it was being drawn.
- Fix edges theme data to not use a rounded rect path for canvas material.
- Add debugging hooks for TextStyle, and fix a warning.

TBR=eseidel

Review URL: https://codereview.chromium.org/1187483003.
2015-06-12 13:25:35 -07:00
Collin Jackson
dd1df9f5ed Animate checkboxes. I based it on the dialer app. Could probably use more improvement, but I think this is an improvement on what we are doing currently.
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1182743002.
2015-06-12 12:45:11 -07:00
Eric Seidel
518ecd24e5 Add support for text styles.
This is a completion of Hans's WIP patch:
https://codereview.chromium.org/1176133002/

Makes it possible for us to style text in fn2 apps.

The title style in the toolbar doesn't look quite right
but as far as I can tell its the same color as the
old typography code produced.  Will need further investigation.

Fixes #213

R=abarth@chromium.org, jackson@google.com

Review URL: https://codereview.chromium.org/1178913003.
2015-06-12 12:28:52 -07:00
Hixie
77dd41ad69 Material and RaisedButton.
Make Material actually create material, with opinions about what that
means.

Make FloatingActionButton use this.

Make Scrollable use this.

Make BoxDecoration support drawing a circle instead of a rectangle, so
that floating action button doesn't need a custom painter.

Implement RaisedButton (and remove button.dart, since there's no
"button" in Material Design).

Make InkWell have a "child" argument instead of "children", and not
have it introduce a Flex into the hierarchy.

Update container.dart example. Clean up some imports.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1179713004.
2015-06-12 11:46:08 -07:00
Hixie
406d7dbae1 Make it possible to test that the stock app doesn't crash on startup and paints the basic scaffold more or less correctly.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1177043008.
2015-06-11 15:36:40 -07:00
Eric Seidel
e8b2d8ad89 Update paths in sky_home.dart
I also removed the leading /, so it is now possible
to use shelldb start sky/sky_home to test.

Also fixed touch_demo.dart and sector layout to
work and not crash.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1177343002.
2015-06-11 15:17:12 -07:00
Matt Perry
08b0b8b540 Fix crash in stocks2 app caused by unspecified PaintBits.
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1182613002.
2015-06-11 16:20:42 -04:00
Hixie
6cf4451a2c Add an example of an app that manipulates both a RenderObject tree and has some fn logic in it.
Also:
 - Make RenderProxyBox non-abstract
 - Upgrade the old container.dart example
 - Minor fixes to ui_mode.dart to make this work

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1183503003.
2015-06-11 13:08:00 -07:00
Matt Perry
85670ba03d Expose and use constants for DrawLooperLayerInfo.setPaintBits to dart.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1175403002.
2015-06-11 15:41:12 -04:00
Adam Barth
dcea536857 Teach stack to size to the max of its non-positioned children
Previously, it would always try to be as big as possible. This CL fixes a
problem with the search bar whereby the text wasn't centered. Now the Stack for
the text sizes its height properly and then becomes centered.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1184483002.
2015-06-11 12:32:43 -07:00
Adam Barth
2a86cc9ae3 Stop the search search button from crashing stocks2
There are still a number of problems with the search feature, but at least it
doesn't crash after this CL.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1179643004.
2015-06-11 11:08:14 -07:00
Hixie
9e73c7eeff Refactor fn2.dart, since it breached our 1000-line threshold.
This moves input.dart to editing2/, since that way we can define the layering as strictly unidirectional.
It also reorders a bunch of imports to fit the style guide.
I removed the old remnants of the widgets example, and put the fn2 examples into the examples/widgets/ directory, to parallel the framework directory names.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1177243002.
2015-06-11 10:26:11 -07:00
Matt Perry
c9dd71253c Fix up constructor naming style for MaskFilter and ColorFilter.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1179913002.
2015-06-11 13:15:20 -04:00
Matt Perry
b973810865 Sky: Small fixes to Gradient interface. Added comments and renamed constructors.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1180873003.
2015-06-11 13:14:51 -04:00
Adam Barth
7d788ecfc9 Make the popup menu animation correct
This CL wires up the opacity of the popup menu items and teaches the popup menu
how to draw its background at the right size.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1175353002.
2015-06-11 10:09:39 -07:00
Adam Barth
80fbf90cb9 Factor BoxPainter out of RenderDecoratedBox
This factoring will more code use BoxPainter in the future (in particular,
PopupMenu).

R=ianh@google.com

Review URL: https://codereview.chromium.org/1180633004.
2015-06-11 09:37:20 -07:00
Adam Barth
d0c30be6ca Make the stocks popup menu fade in
The final animation is more involved, but this CL starts implementing the menu
animation by making it fade in.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1174253003.
2015-06-10 17:28:43 -07:00
Hixie
508ff93761 Spinning Square example for the RenderObject API.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1178783002.
2015-06-10 17:27:49 -07:00
Collin Jackson
dd0cc7fc0b Support for alignItems (test incoming)
R=abarth@chromium.org, abarth, hansmuller

Review URL: https://codereview.chromium.org/1181533003
2015-06-10 16:35:49 -07:00
Collin Jackson
86b2b3ed28 Clip inkwell splash around the floating action button
R=abarth@chromium.org, ianh@google.com, abarth

Review URL: https://codereview.chromium.org/1174203002
2015-06-10 15:57:26 -07:00
Hixie
4ce574a199 Abstract out the AppView logic in fn so that it can also be used in non-pure-fn apps.
This lays the groundwork for using fn widgets in static environments.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1178703002
2015-06-10 15:55:25 -07:00
Hixie
4811d49753 Dispatch events to fn nodes for each RenderObject that the event goes through, instead of starting at the innermost target and just propagating through our tree.
This starts laying the groundwork for fn disconnected subtrees that are linked together into one RenderObject tree.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1181503002
2015-06-10 15:51:24 -07:00
Collin Jackson
e09dd96195 Fix analyzer warnings (and probably also bugs) in flex.dart
R=abarth@chromium.org, hixie

Review URL: https://codereview.chromium.org/1181523002
2015-06-10 15:36:12 -07:00
Adam Barth
358a22c9da Rename BlockContainer, StackContainer, and FlexContainer
These are now called Block, Stack, and Flex, respectively. Less verbose.

R=jackson@google.com, ianh@google.com

Review URL: https://codereview.chromium.org/1181533002.
2015-06-10 15:34:30 -07:00
Hixie
df5e4833d6 Replace some 'as' operators with equivalent code that doesn't do any checks in production mode.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1181453003
2015-06-10 15:00:34 -07:00
Hixie
9470872543 Fix inconsistency about how to spell "statusBar" which was causing warnings.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1174143002
2015-06-10 14:24:35 -07:00
Adam Barth
19d0230a33 Ink should propagate at a constant velocity
Previously it was propagating for a constant duration.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1173173002.
2015-06-10 14:16:11 -07:00
Hixie
5a9c944b7b Change how we narrow the "root" type on RenderObjectWrappers.
Turns out that reintroducing the field in each subclass is probably allocating more storage per node. So let's not do that.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1177483004
2015-06-10 14:13:36 -07:00
Adam Barth
df472efd57 Ink splashes should start at the touch point
Previously, they always started at the center of the RenderInkWell. Now we
remember the local coordinates we computed during the hit test and provide that
information when handling the event.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1180553002.
2015-06-10 13:55:20 -07:00
Hixie
32f027b65f Add some TODOs for renaming onTick and onValueChanged.
I'd do it now, but these files are still being used by fn.dart/stocks1, and it's not worth forking the whole animation directory just for this.

TBR=abarth

Review URL: https://codereview.chromium.org/1170033005
2015-06-10 13:43:42 -07:00
Hixie
47b275c1ad Kill onDidMount()/onDidUnmount() in favour of just overriding the relevant methods.
In general, we are hugely inconsistent in what onFoo/onFoo() means.
I'm cleaning out all the cases where onFoo() is a method.

Also, this fixes EditableText, which got missed in the recent syncFields() pass.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1175753003
2015-06-10 13:30:50 -07:00
Collin Jackson
56d1aa0b94 Fix cross size of flex items in stocks app (more tests incoming)
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1176053002
2015-06-10 12:54:26 -07:00
Adam Barth
4806a4cc04 Remove _emptyList from fn2.dart
We can use const [] instead and we'll be sure we don't mutate this constant.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1178623002.
2015-06-10 12:42:41 -07:00
Eric Seidel
58068b9e41 Add TODOs about components needing to adjust to screen size changes.
Our current static view_configuration design cannot work.

https://github.com/domokit/mojo/issues/231

R=ianh@google.com

Review URL: https://codereview.chromium.org/1169813009.
2015-06-10 11:28:00 -07:00
Eric Seidel
c87b98b687 Enable antialiasing on Paint by default.
The app looks so much better with this on.

R=jackson@google.com, abarth@chromium.org

Review URL: https://codereview.chromium.org/1172413002.
2015-06-10 11:11:03 -07:00
Hans Muller
c572af7f6e Right-size the toolbar
Tweaked the layout in Scaffold a little: the Scaffold
accounts for the (Android) notification bar's height,
instead of the ToolBar. I think it would be best if
moving the app below the notification area were handled
at a lower level. Doing it in Scaffold seemed OK for the
moment, since one could put a ToolBar component anywhere
in an app.

Closes #208

R=ianh@google.com

Review URL: https://codereview.chromium.org/1171173003.
2015-06-10 11:06:50 -07:00
Hixie
003083a12d Remove one more use of mirrors: Components now have to explicitly sync their fields.
This also removes one bit of magic to make it more obvious what on is
going on during a sync, which should hopefully help.

Components have to decide if they support being stateful or not. If
they do, then they must implement syncFields() and have mutable
fields; if they don't, then they must have final fields. This isn't
particularly enforced, though.

This also renames _willSync() to _retainStatefulNodeIfPossible(), for
clarity, and fixes some minor style issues and one typo that was
breaking the drawer.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1174023003
2015-06-10 10:33:04 -07:00