74 Commits

Author SHA1 Message Date
Hans Muller
9ac347da62 Dismissable animation simplifications; added backgrounds to CardCollection cards 2015-07-24 11:15:37 -07:00
Adam Barth
edd9ddccb4 Remove the magic from the Sky package
We now just symlink the lib directory into the packages directory in the output
directory.
2015-07-23 16:52:32 -07:00
Adam Barth
1892149897 Move Material Design Icons to their own package
After this patch, we use pub to manage versioning and fetching the material
design icons.
2015-07-23 14:54:59 -07:00
Adam Barth
8a64baca3d Merge pull request #241 from abarth/sky_shell_apk
Create a SkyShell.apk
2015-07-23 13:32:15 -07:00
Adam Barth
c14ba33667 Create a SkyShell.apk
This CL introduces a SkyShell.apk that is separate from the SkyDemo.apk that we
upload to the store to show our demos.  The SkyShell.apk is just an empty shell
that can run Sky applications on Android.
2015-07-23 13:26:01 -07:00
Hixie
4e2893802d Remove the scheduleBuild() API.
I've noticed an anti-pattern emerge where people call scheduleBuild()
when they think they've changed enough state that they should rebuild,
instead of just wrapping their changes in setState(). This leads to
them missing state changes, having extraneous scheduleBuild() calls,
and other similar bugs.

By removing scheduleBuild(), the only way to actually schedule a build
now is to call setState(), and hopefully that'll make it much clearer
that you're only supposed to do this when you change state.
2015-07-23 12:55:48 -07:00
Hixie
eb90899aab Track global keys globally.
Assert that there are no duplicates.
Export GlobalKey from basic.dart, so that people don't have to import widgets.dart just for that.
Fix the "initialFocus" feature which actually didn't work.
2015-07-23 11:10:04 -07:00
Adam Barth
7224089c9f Merge pull request #230 from abarth/use_dart_http_server
Switch sky_tool to use a Dart-based HTTP server
2015-07-23 09:28:40 -07:00
Hixie
144fe36e25 RenderConstrainedBox was ignoring its additional constraints for its intrinsic size logic when it had no child. 2015-07-23 09:06:34 -07:00
Adam Barth
5aeff1ac1d Merge pull request #233 from abarth/fix_analyzer
Fix analyzer warnings
2015-07-23 08:56:10 -07:00
Adam Barth
59798b982e Fix analyzer warnings
- Remove unused imports
 - Remove unused, broken constructor for MineDiggerApp
2015-07-23 08:54:51 -07:00
Hixie
3aa0437ff2 Rename defaultFocus to initialFocus. 2015-07-23 08:43:40 -07:00
Eric Seidel
4da276710f Focus support.
This patch provides a class to manage focus, Focus, and a class to
manage ownership of the keyboard, KeyboardHandle.

Inherited (in widgets.dart) is adjusted to support subclasses that
need to copy state from instance to instance.

A GlobalKey key type is introduced that is basically the same as
UniqueKey. Component classes that need a globally-unique key can
specify that their 'key' constructor argument is a GlobalKey.

Focus
-----

You can use `Focus.at(this)` to determine if you, a Component, are
currently focused.

You can use `Focus.moveTo(this)` to take the focus or give it to a
particular component.

For this to work, there has to be a Focus class in the widget
hierarchy.

Currently, there can only be one Focus class, because nested scopes
aren't supported. We should add support for that in a future patch.
See issue #229.

KeyboardHandle
--------------

Instead of directly interacting with the keyboard service, you now ask
for a KeyboardHandle using `_keyboard.show(client)`. This returns a
KeyboardHandle class. On that class, you can call `handle.release()`
when you want to hide the keyboard. If `handle.attached` is still
true, and you need to reshow the keyboard after the user hid it, then
you can can `handle.showByRequest()`.

The point of this is that the `keyboard.show()` method maintains the
invariant that only one KeyboardHandle is live at a time.

There are some issues with the keyboard service that I filed as a
result of doing this patch: #226 #227
2015-07-23 08:43:40 -07:00
Adam Barth
278e0ab29d Switch sky_tool to use a Dart-based HTTP server
The Python HTTP server was caching too agressively. Instead, use an HTTP server
written in Dart from the sky_tools package.
2015-07-23 00:22:41 -07:00
Ian Hickson
3d41fb8a89 Merge pull request #215 from Hixie/crash-settings
Fix the crash when going to settings after showing the popup menu.
2015-07-22 18:16:08 -07:00
Hixie
bf33f1fcc6 Make center part of toolbar optional. 2015-07-22 15:57:51 -07:00
Hans Muller
571a92ce3b Dismissable provides intrinsic support for resize animation 2015-07-22 12:55:45 -07:00
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
Hixie
4dacd69b41 Don't set keys on images, etc, pre-emptively.
In theory, before, if you had the same image twice in a scrolling container, you'd get an assertion with no way around it.
This makes those nodes not bother making keys by default, which is cheaper and more correct.
2015-07-22 10:05:19 -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