244 Commits

Author SHA1 Message Date
Eric Seidel
5b4d3452bc Merge pull request #154 from domokit/sethladd-patch-2
Fix typo in Sky's framework's README
2015-05-08 13:09:18 -07:00
Hixie
e8ead8bbbe [Effen] Port fn.dart from the legacy sky.Node backend to the RenderNode backend, which is currently just a sky.Node-backed shim, but will eventually be the core Sky interface for layout and painting.
- the custom layout class in fn is removed by this patch; a new class
  will be added in a later CL

- the version of layout.dart in this CL is a subset of what we're
  targetting on the long run with
     https://codereview.chromium.org/1093633002

- a couple of lines of dead code are removed in this CL also

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1117143003
2015-05-08 13:06:47 -07:00
Seth Ladd
bf8418349e Fix typo in Sky's framework's README 2015-05-07 18:40:32 -07:00
Eric Seidel
d04c87cbbc Rename view-configuration to view_configuration to make analyzer happy.
Analyzer was complaining about '-' not being an allowed character
in dart file names.

R=jamesr@chromium.org
2015-05-04 14:18:19 -07:00
Hixie
8c4d2556e6 [Effen] fix some dart warnings (mostly unused imports)
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1104233003
2015-04-27 10:54:26 -07:00
Hixie
122a5220a1 [Effen] stop using custom layout for now, since it's in flux
TBR=hansmuller

Review URL: https://codereview.chromium.org/1102393002
2015-04-27 09:18:01 -07:00
Zachary Anderson
ec37fed8f9 Dart: Put generated .mojom.dart files under mojoms pacakge.
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1092793005
2015-04-23 15:23:50 -07:00
Hixie
a2e1ec82f5 [Effen] Tapping on a menu while it's closing should not make it instantly disappear.
This tries to make the menu controller more careful about the state
transitions it goes through, in particular, not firing off animations
while we're already closing (since that used to trigger the "we're
done animating" callback which then closes the menu forcibly).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1074883005
2015-04-23 13:20:39 -07:00
Hixie
830f8bf0f7 [Effen] Prevent scrolling past the bottom of a scrollable list.
- make the ScrollBehavior instance long-lived, rather than recreating
  it each time we update the list contents.
- have OverscrollBehavior track the total height of the contents and
  the height of the scrollable region, so that it can determine when
  to stop scrolling down.
- teach OverscrollBehavior about how to determine when to stop
  scrolling down, and how to bounce when it's too far down.
- replace the 'energy' concept in Particles with a method that sets
  the energy and direction at the same time, instead of assuming that
  the direction is always positive when setting energy.
- make FixedHeightScrollable lists track the number of items in the
  list and have them update their ScrollBehavior regarding this
  information as it changes.
- track how many items are currently showing in the list stock list.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1097373002
2015-04-21 13:20:30 -07:00
Dave Moore
1d74d5f631 Add sensors application to mojo
R=qsr@chromium.org

Review URL: https://codereview.chromium.org/1093033002
2015-04-21 09:56:05 -07:00
Hixie
0b125319e5 [Effen] Make the material splashes a bit lighter.
TBR=eseidel

Review URL: https://codereview.chromium.org/1065643003
2015-04-20 16:08:25 -07:00
Hixie
2f37fc0928 [Effen] Typo in splash code: s/sise/size/
TBR=eseidel

Review URL: https://codereview.chromium.org/1066513006
2015-04-20 15:55:11 -07:00
Hixie
1b76bf43d1 [Effen] Reduce splashes when scrolling.
Pipe the remaining time for an animation all the way out to the AnimatedValue.
Make splashes abortable, which causes them to continue to fade but no longer grow, by having them fade in 100ms or however long the animation was still going to go for, whichever is quickest.
Make Scrollables support objects registering with them to be told when scrolling happens.
Make UINode support subclasses being informed when _remove() was called.
Hook all that together to make splashes go away when scrolling by having them register with any ancestor Scrollables such that when those scroll, all the splashes get aborted. Unregister when removed.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1092423003
2015-04-20 15:51:24 -07:00
Hixie
f646c8ac58 Make the keyboard reappear when you tap on a text field after having dismissed the keyboard.
- the keyboard service now has a showByRequest() method that invokes Android's InputMethodManager's imm.showSoftInput with no flags set.
- the Input component calls through to the keyboard service's showByRequest() when it receives a pointer down.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1089163005
2015-04-20 11:45:33 -07:00
Hixie
33e9822625 [Effen] implement bounce back behaviour for lists.
Turns out this is
actually three simulations in a row, so we now have a system that can
transition from one to another.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1100583002
2015-04-20 11:44:45 -07:00
Hixie
ddc2ffd0c7 [Effen] typo fix: 'cusor' => 'cursor' in editable_text.dart
TBR=eseidel

Review URL: https://codereview.chromium.org/1070313005
2015-04-17 12:13:27 -07:00
James Robinson
1c5cac4efa Expose sky KeyboardService in android mojo_shell
R=eseidel@chromium.org, qsr@chromium.org

Review URL: https://codereview.chromium.org/1088793003
2015-04-16 17:11:15 -07:00
Zachary Anderson
11315b5314 Uses mojom module names as Dart's package: import URI
At present there is a special case in Dart bindings generation which
makes the Mojo SDK and things under mojo/services portable. However,
we must not require things under mojo/services to be next to the
Mojo SDK under mojo/public/... in client repos. Further, other
collections of mojoms should also be portable.

To fix this, instead of using the path in the host repo as the
canonical package: import URI for the generated Dart code, this CL
uses the mojom module name.

BUG=https://github.com/domokit/mojo/issues/73
R=blundell@chromium.org, johnmccutchan@google.com, tonyg@chromium.org

Review URL: https://codereview.chromium.org/1071693003
2015-04-16 07:50:47 -07:00
Hixie
f76dd382b8 [Effen] We need to update the layout manager in _syncNode() also,
otherwise when you switch from one Container instance to another, you
end up with the the layout being done by the wrong instance.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1086983004
2015-04-14 13:35:24 -07:00
Hixie
0e24ccd944 [Effen] Custom layout. For now, FixedHeightScrollable uses a custom BlockLayout algorithm, mostly as a proof of concept.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1064983002
2015-04-14 10:38:05 -07:00
Hans Muller
ef3df2f4fb Scrollable should use scrollTo() instead of setting _scrollOffset directly, when starting an animation.
I'd missed this case when adding Scrollable.scrollTo()
https://codereview.chromium.org/1074033002

R=ianh@google.com

Review URL: https://codereview.chromium.org/1082163002
2015-04-14 10:01:44 -07:00
Hans Muller
b215015056 Added Scrollable.scrollTo()
A subclass could override this method to limit scrolling or to initialize the scroll offset.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1074033002
2015-04-09 17:02:49 -07:00
Hixie
8c8ad532f4 [Effen] fix typo in animation code (impluse => impulse)
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1076963002
2015-04-09 16:03:09 -07:00
Hixie
868b53259e [Effen] Use a Style element instead of inline style for the Text fn node's sky
element with display:paragraph, so that the C++ side shares RenderStyles.
(based on review comments on https://codereview.chromium.org/1078973002 )

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1070243003
2015-04-09 16:00:10 -07:00
Hixie
3067bb641a [Effen] make fn wrap text in display:paragraph nodes
R=eseidel@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/1078973002
2015-04-09 15:47:36 -07:00
Hixie
97ed9fdd7d [Effen] rename RenderNode and WrapperNode (previously know as Element) to SkyNodeWrapper and SkyElementWrapper to avoid confusion with C++ RenderNode objects
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1066093003
2015-04-07 14:12:32 -07:00
Eric Seidel
e8140cd33f Unbreak widgets_app.dart (by disabling PopupMenu for now)
Also fix button.dart to include ink_well.dart.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1058013003
2015-04-07 11:17:26 -07:00
Ojan Vafai
88f38ce0e6 Remove all uses of display:block and display:inline-block.
-Make display:flex, flex-direction: column, flex-shrink: 1 the default.
-Simplify StyleAdjuster::adjustStyleForAlignment to remove special cases we
won't need as we make flex the default and remove absolute positioning.
-Fix a bug this exposed in column flexboxes where we'd apply the wrong edge
of border/padding/margin.
-For now leave the default of align-items:stretch. The main change here is
that iframe/img will do width:auto the same as blocks (i.e. the width of
the parent). I think this is a good change, but we'll have to see how it feels
in practice.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1061163002
2015-04-06 16:44:12 -07:00
Tony Gentilcore
cd1ca3d88b Revert API change from issue 1053883002.
tl;dr is that unless the Proxy is passed, the caller doesn't know
whether it's a Stub or Proxy (or whether it's bound).

See that patch for further explanation.

BUG=
R=hansmuller@google.com

Review URL: https://codereview.chromium.org/1052693003
2015-04-02 08:38:33 -07:00
Tony Gentilcore
0bbc4cee4a Make embedder.serviceRegistry return a ServiceRegistry instead of ServiceRegistryProxy.
The proxy has methods like close() that I think we're not intending to expose to the
caller. The ServiceRegistry is just the interface itself. This also avoids users of
the API from having to add a .ptr to their usages of the registry.

BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1053883002
2015-04-01 16:33:16 -07:00
Hixie
1ad52007bd [Effen] Remove '_isInCheckedMode' flag and use an assert() instead, since presumably that will more reliably get compiled out in prod builds.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1052793002
2015-04-01 14:28:14 -07:00
Hixie
e3318005f4 [Effen] missed an underscore in the _ensureDepth() logic
TBR=eseidel

Review URL: https://codereview.chromium.org/1056633002
2015-04-01 12:39:59 -07:00
Hixie
ee63773cd1 [Effen] fix _ensureDepth to work on root of tree, oops
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1050153002
2015-04-01 12:08:06 -07:00
Hixie
6ff2cfbe82 [Effen] use the fact that the parent knows its depth already to avoid walking the entire tree each time, and simplify how we build the trace message
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1051913002
2015-04-01 10:30:45 -07:00
Hixie
c0067cceba [Effen] s/Node/UINode/, s/Element/WrapperNode/, s/EventTarget/EventListenerNode/
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1043283003
2015-04-01 09:46:28 -07:00
Hans Muller
867df1ba15 Effen error if a component ancestor doesn't specify a style
If a component ancestor doesn't specify a style, quietly ignore it.

Currently the result is a little confusing:

[0330/124031:ERROR:dart_error.cc(20)] Unhandled exception:
Uncaught Error: The null object does not have a getter '_className'.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1041863003
2015-03-30 14:16:40 -07:00
Adam Barth
8c5939bb7c Fix deploy_sdk.py to include README.md and stock data files
Also, remove testplan.txt, which isn't part of the framework.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1038273002
2015-03-26 17:26:04 -07:00
Adam Barth
8aff978b43 Improve Sky READMEs
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1037163002
2015-03-26 17:17:34 -07:00
Adam Barth
51e3fce449 Clean up examples directory
1) Merge input example into widgets example
2) Move single-file, non-fn examples into a "raw" directory
3) Rename stocks-fn and widgets-fn to stocks and widgets

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1005393006
2015-03-26 14:32:40 -07:00
Hans Muller
aab55efe9c Fix a typo in embedder.dart
Connection has two Ns. It was me.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1020073003
2015-03-25 16:34:49 -07:00
Rafael Weinstein
36ad366ba0 [Effen] Add a basic layout test
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1038583003
2015-03-25 10:53:51 -07:00
Adam Barth
707968b1db Menu in StocksApp should dismiss when tapping elsewhere
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
2015-03-25 10:43:35 -07:00
Adam Barth
171ff643ef Disentangle Material and InkSplash
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
2015-03-25 10:43:12 -07:00
Adam Barth
4f29d04e2e Add an implict animation between ActionBar backgrounds
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
2015-03-25 10:42:42 -07:00
Adam Barth
bfd2651acb Remove the |style| parameter from Material
There's no reason for Material to take a |style| parameter anymore. Clients can
simply use StyleNode instead.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1030963005
2015-03-25 10:42:19 -07:00
Adam Barth
c6fa902d79 Remove the |style| parameter to InkWell
There's no reason for InkWell to take a |style| parameter anymore. Clients can
simply use StyleNode instead.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1019443003
2015-03-25 10:41:38 -07:00
Adam Barth
f2ce04fb3d Menu in StocksApp should animate out
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
2015-03-25 10:40:29 -07:00
Adam Barth
040c83d59a Clean up stock_app.dart
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
2015-03-24 18:00:33 -07:00
Adam Barth
f3df64fa3d Let Dart code running in Sky add events to the trace timeline
This will let us form a wholistic picture of work done in the framework and in
the engine.

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

Review URL: https://codereview.chromium.org/1028243003
2015-03-23 14:48:06 -07:00
Hixie
e42426a37c [Effen] put Node class above its superclasses
TBR=rafaelw

Review URL: https://codereview.chromium.org/1030753002
2015-03-23 14:44:18 -07:00