56 Commits

Author SHA1 Message Date
Hixie
a50b065197 Fix the crash when going to settings after showing the popup menu.
If your constraints are tight when you get laid out, you don't get a
relayout subtree root.

If you don't have a relayout subtree root, and you get marked dirty,
you go through layoutWithoutResize() rather than layout(), so we don't
get a parentUsesSize.

If you're not dirty and your constraints didn't change, layout() skips
your layout.

So then if your initial layout had parentUsesSize:true, and then you
got marked dirty directly, you would set your size with
parentCanUseSize=false, and then later if your parent tried to lay you
out then read your size, it would crash because your size wasn't set
up to allow you to get your size.

The fix is to actually remember the last setting of parentUsesSize,
even in the case of the constraints being tight and you later being
marked as needing layout directly.
2015-07-22 10:10:58 -07:00
Adam Barth
3d0b82eb86 Use a null LayoutCallbackBuilderHandle in Release 2015-07-22 10:02:00 -07:00
mpcomplete
2c84154b75 Merge pull request #211 from mpcomplete/rm.builder.3
Make SnackBar animate itself.

This introduces a bit of a regression - the FloatingActionButton no longer animates. I'm not sure yet how to animated the FAB along with the SnackBar. Maybe some notion of anchoring a node to another.

Also remove last use of AnimationBuilder.
2015-07-22 12:29:57 -04:00
Hixie
74575775bd Introduce an explicit Key type.
This fixes some theoretical bugs whereby we were using hashCode to try
to get unique keys for objects, but really we wanted object identity.
It also lays the groundwork for a new GlobalKey concept.

I tried to keep the impact on the code minimal, which is why the "Key"
constructor is actually a factory that returns a StringKey. The code
has this class hierarchy:

```
   KeyBase
    |
   Key--------------+---------------+
    |               |               |
   StringKey    ObjectKey       UniqueKey
```

...where the constructors are Key and Key.stringify (StringKey),
Key.fromObjectIdentity (ObjectKey), and Key.unique (UniqueKey).

We could instead of factory methods use regular constructors with the
following hierarchy:

```
   KeyBase
    |
   LocalKey---------+---------------+
    |               |               |
   Key      ObjectIdentityKey   UniqueKey
```

...with constructors Key, Key.stringify, ObjectIdentityKey, and
UniqueKey, but I felt that that was maybe a more confusing hierarchy.
I don't have a strong opinion on this.
2015-07-22 09:14:06 -07:00
Matt Perry
371ef4542b Material animates over 200ms 2015-07-22 11:55:38 -04:00
Matt Perry
b31e06a5d6 Make SnackBar animate itself. 2015-07-22 11:53:57 -04:00
Matt Perry
839e997e78 rebase 2015-07-22 11:52:34 -04:00
Adam Barth
136b2709c8 Merge pull request #208 from abarth/fix_type
Fix type error found by dartanalyzer --strong
2015-07-22 07:29:32 -07:00
Adam Barth
bb8b9c611c Fix type error found by dartanalyzer --strong
We were declaring that the function passed to setState should return a
Function. In reality, we want the function to return void (and everyone calls
it with a function that returns void).
2015-07-21 22:42:04 -07:00
Adam Barth
665f6c33a4 Update sky_tool now that sky:// isn't a thing
Instead, just use a normal http URL.
2015-07-21 19:53:25 -07:00
Hixie
6d304c03ac Remove redundant operator== and hashCode functions in card example.
It turns out that we aren't really using these. The identity logic is sufficient.

Also, add some asserts for a crash I had once but couldn't reproduce, in case that helps catch it next time.
2015-07-21 15:26:54 -07:00
Hixie
9da399b0e1 Rationalise usage of keys in navigator.dart.
Route (named routes) no longer have a key, and have their own storage for their names.
RouseState no longer has a key, and uses an owner field pointing to a StatefulComponent instead.
As such, RouteBase no longer has a key.

HistoryEntry no longer uses a global int to ensure uniqueness.

Propagated this to stocks app.
2015-07-21 14:58:48 -07:00
Adam Barth
de717bafe9 Images don't appears in VariableHeightScrollables
When we build widgets during layout we weren't notifying those widgets that
they were mounted. Now we notify mount status changes when exiting build phases
inside layout.

Fixes #176
2015-07-21 14:42:21 -07:00
Adam Barth
6b748e653e Fix more analyzer warnings 2015-07-21 13:59:18 -07:00
Adam Barth
53efc748e1 Merge pull request #191 from abarth/image_height_width
Separate width and height parameters for Image widgets
2015-07-21 13:54:56 -07:00
Adam Barth
012b915704 Separate width and height parameters for Image widgets
This change makes it easier to defined only the width or the height of an image
and let the other value be filled in from the image's intrinsic aspect ratio.

Fixes #175
2015-07-21 13:46:10 -07:00
Matt Perry
0fd3302ebe Renamed AnimatedType to AnimatedValue 2015-07-21 12:55:16 -07:00
Hixie
f3e07210b0 Make typography.white and typography.black constants. 2015-07-21 12:13:10 -07:00
Hans Muller
d8a4a099e0 animate "snap back", only call dismiss() once 2015-07-21 11:20:01 -07:00
Hans Muller
f72d61bf5f manage listener with on,didMount 2015-07-21 08:42:14 -07:00
Hans Muller
3f70271d9b manage listener with on,didMount 2015-07-21 08:41:58 -07:00
Hans Muller
b0e0e65c09 Fixed several typos 2015-07-21 08:25:49 -07:00
Adam Barth
7af81f208a Fix typos in RenderImage
This function took innerConstraints as an argument but used constraints internally.
2015-07-20 20:04:03 -07:00
Collin Jackson
40b2a4e53f Merge pull request #166 from collinjackson/fitness
Measurement tracking for fitness app.

There is an issue with the input control that prevents actually creating a measurement. Working on this with eseidel.

R=eseidel
2015-07-20 16:25:19 -07:00
Collin Jackson
d8cbbc68f3 Add basic measurement functionality to fitness app 2015-07-20 16:20:59 -07:00
Hans Muller
b954e020c6 Make it possible to identify BlockViewport children whose size or type has changed 2015-07-20 15:41:21 -07:00
Collin Jackson
e90d0ec807 Merge remote-tracking branch 'upstream/master' into baseline5
Conflicts:
	sky/sdk/lib/rendering/flex.dart
2015-07-20 10:26:06 -07:00
Collin Jackson
8bf1f86a24 abarth feedback 2015-07-20 10:24:52 -07:00
Collin Jackson
8e68805a72 Merge pull request #123 from collinjackson/baseline6
Support for non-alphabetic baselines
2015-07-20 10:18:15 -07:00
Adam Barth
b5347ce556 Improve the READMEs further 2015-07-18 12:34:40 -07:00
Collin Jackson
4604021dd3 Support for non-alphabetic baselines 2015-07-17 17:06:08 -07:00
Collin Jackson
e3d5c2b25e Draw debug rects when flex overflows 2015-07-17 17:04:59 -07:00
Collin Jackson
62fc9d8515 Track overflow during flex layout 2015-07-17 16:13:15 -07:00
Collin Jackson
c80f1c7c31 Merge pull request #95 from collinjackson/baseline
Fix #57 Flex needs to understand baselines
2015-07-17 14:29:29 -07:00
Collin Jackson
695a13583b Update example 2015-07-17 14:29:05 -07:00
Collin Jackson
07f9c95efc Fix comments 2015-07-17 12:49:37 -07:00
Collin Jackson
7a7110b2a0 Fix #57 Flex needs to understand baselines 2015-07-17 12:46:51 -07:00
Adam Barth
f3d913c514 Refactor Material animation to use AnimatedContainer
The idea is that AnimatedContainer is a drop-in replacement for Container that
provides implicit animations when its properties change.

R=mpcomplete@google.com
2015-07-17 12:23:46 -07:00
Collin Jackson
d6232c3c71 Remove unused import 2015-07-17 10:18:32 -07:00
Collin Jackson
cc29757eee Navigator improvements, avoid building invisible routes 2015-07-17 09:38:22 -07:00
Collin Jackson
fd744a1244 Use unique integers as the key for history items to prevent collisions 2015-07-17 09:05:46 -07:00
Collin Jackson
99346d00c1 abarth feedback 2015-07-16 17:39:36 -07:00
Collin Jackson
a54f7cf265 Fix bug when having more than 2 routes 2015-07-16 17:36:45 -07:00
Collin Jackson
38cbf9b5d3 Support for settings fly-in animation 2015-07-16 17:22:20 -07:00
Hixie
a77a9c18b2 Remove EventTarget, and subsequent fallout.
The primary goal of this change was to remove EventTarget from the
sky_engine C++ code. Since EventTarget is so core to the entire event
system that sky_engine was based on, this is a rather invasive change.
As such, it had some knock-on effects. I deleted some of the files
that were affected, and cauterised the remainder.

In many cases, a file would depend on another file that it didn't
include directly, but instead included indirectly via another file
that I deleted. When this happened, if the features that this broke
were obsolete, I sometimes just removed the features instead.

Specifically:
- removed EventTarget
- removed EventQueue, since without a target, what's a queue going to
  do?
- same with EventDispatch*
- removed ExecutionContext, since it had an EventQueue and nothing
  else it did was relevant to Sky anymore
- removed ActiveDOMObject, which was all about ExecutionContexts
- removed ContextLifecycleNotifier since it dependend on
  ExecutionContext and ActiveDOMObject
- removed the other Lifecycle classes for consistency, and replaced
  them with four booleans in the Document class
- removed some of the attributes that are no longer relevant from
  IDLExtendedAttributes (ConstructorCallWith and
  CallWith=ExecutionContext)
- removed the Document member on DOMDartState since we never set it to
  anything but null.
- removed BuiltinSky::InstallWindow since it relied on the Document
  member of DOMDartState
- removed EventHandler, EventListener, and mentions of those in
  various binding scripts
- removed NewEventHandler, since we're not using that either
- removed the following interfaces from the Sky Dart API:
  - EventTarget
  - EventListener (since without a target, there's no way to listen)
  - FocusEvent (since it's only member was an EventTarget)
  - HashChangeEvent (mostly by accident, but it's defunct anyway)
  - FontFace (it used ConstructorCallWith=ExecutionContext)
- changed the following interfaces of the Sky DART API:
  - MediaQueryList is no longer an EventTarget
  - Node is no longer an EventTarget
  - Document no longer has defaultView (depended on
    DOMDartState's document)
  - DocumentFragment, Element, Range, and Text no longer have a
    constructor (they all depended on DOMDartState's document, which
    is now gone)
  - Event lost its EventTarget members and path.
  - Window lost its WindowTimers partial interface (it used
    EventTarget and ExecutionContext a lot)
- removed numerous hacks in the bindings around features that are now
  gone, like addEventListener
- removed a bunch of console logging code, since that relied on
  ExecutionContext
- cauterised the wound in FontFace.cpp by removing constructors and
  methods that called now-removed features
- same with MediaQuery and friends
- same with some editor features and focus-related features
- same with Document
- removed DOMTimer classes since they use ExecutionContexts
2015-07-16 14:40:10 -07:00
Matt Perry
c491ad7cbe Add forces.dart 2015-07-16 13:09:30 -07:00
Matt Perry
7724dc7587 apply.patch 2015-07-16 12:34:11 -07:00
Collin Jackson
633b65010c After running filter-branch, move root directory into sky/ 2015-07-16 11:54:25 -07:00
John McCutchan
57ec759e97 Rationalize Dart mojo and sky package structure.
NOTE: This CL appears far larger than it actually is for two reasons:

1) Many files were moved around to use the Dart package directory structure.
2) Many .dart files had to have import paths updated.

- Organize mojo/public/dart so that it uses standard Dart package layout
- Organize mojo/dart/apptest so that it uses a standard Dart package layout
- Organize sky/sdk so that it uses a standard Dart package layout
- Create a mojo/testing package (used by unittests)
- Introduce the 'dart_pkg' gn rule which populates gen/Config/dart-pkg
- All internally vended Dart packages must have a corresponding dart_pkg rule
- It is now possible to use dependency_overrides: in pubspec.yaml to mix internal and external package dependencies (enables analyzer, editor, webstorm usage for internal developers).
- Package root for dart content handler ends with "packages/"
- Imports of mojo package uris no longer need the "public/dart"
- mojo/public/tools/dart_package.py is a clone of mojo/public/tools/gn/zip.py
- Sky tests no longer run 'deploy_sdk' script.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1132063007
2015-05-18 14:41:39 -07:00
Eric Seidel
8c50d9339c Update SDK README to discuss about:tracing and observatory.
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1114553004
2015-04-28 12:05:46 -07:00