Commit graph

573 commits

Author SHA1 Message Date
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 1570b17237 Merge pull request #245 from abarth/sky_engine_package
Add a sky_engine package to contain the dart:sky SDK extensions
2015-07-23 14:18:05 -07:00
Adam Barth dfce6c7191 Add a sky_engine package to contain the dart:sky SDK extensions 2015-07-23 14:17:35 -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
Viktor Lidholt 765881f264 Merge pull request #223 from vlidholt/master
Adds custom play button with texture to demo game
2015-07-23 13:30:25 -07:00
Viktor Lidholt 9a834384f1 Adds custom play button with texture to demo game 2015-07-23 13:27:17 -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
Eric Seidel 8998132d94 Add C++ based support for drawAtlas
This is supposed to make Viktor's game faster, but it's not clear
to me that it actually does.  I've left the code
using the dart version of drawAtlas for now until Viktor can
verify that it looks correct.

I also added a wrapper for SkFilterQuality in the process of
debugging SkCanvas.drawAtlas since all drawAtlas examples
in Skia use FilterQuality.low.  The bug which blocked me for
so long turned out to be that SkCanvas.drawAtlas doesn't
draw anything if antialiasing is turned on.

Issue #138.

R=abarth@google.com
2015-07-23 09:25:10 -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 3331d44f2d Don't try to access the network in Stocks test
Accessing the network created a race condition that would sometimes cause other
tests to fail.
2015-07-23 08:39:42 -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
Viktor Lidholt 35b5ecf873 Merge branch 'master' of github.com:domokit/sky_engine 2015-07-22 10:37:55 -07:00
Viktor Lidholt 34e1268f1f Adds scoring and level up in game demo 2015-07-22 10:37:28 -07:00
Collin Jackson eced8b3cbd Fix build 2015-07-22 10:28:43 -07:00
Collin Jackson ad569a2393 Merge remote-tracking branch 'dk/master' into meal
Conflicts:
	sky/sdk/example/fitness/lib/feed.dart
2015-07-22 10:21:48 -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
Viktor Lidholt bb0c8bb13e Merge pull request #202 from vlidholt/master
Fixes issues with invalidating matrix for SpriteBox & adds HUD to demo game
2015-07-22 09:01:39 -07:00
Viktor Lidholt 6a6567d776 Fixes formatting and removes redundant code in sprites 2015-07-22 08:59:14 -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
Ian Hickson b215e4d6c0 Merge pull request #205 from Hixie/minedigger
Many code improvements to Mine Digger.
2015-07-22 08:23:55 -07: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 9fd0be564b Update README.md
Grammar
2015-07-21 22:49:00 -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 73123a3c08 Merge pull request #201 from eseidelGoogle/fuzz_crashes
Fix 2 crashes found by Hixie's fuzzer.
2015-07-21 19:59:24 -07:00
Adam Barth 516e6b6e27 Update README.md 2015-07-21 19:56:57 -07:00
Adam Barth f6eb26c0ef Merge pull request #207 from abarth/fix_sky_tool
Update sky_tool now that sky:// isn't a thing
2015-07-21 19:53:59 -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
Adam Barth 0a427a0a86 Update README.md 2015-07-21 19:50:44 -07:00
Adam Barth be8b92cd84 Update README.md 2015-07-21 19:41:13 -07:00
Adam Barth 9ee93ebad8 Roll Sky package version 2015-07-21 17:29:58 -07:00
Hixie 4d2902f219 Many code improvements to Mine Digger.
Text styles are now a global constant instead of being initialised dynamically.
There are now sufficient text styles for 8 mines around a square.
I coallesced Game and MineDiggerApp.
Used an enum instead of constants for the cell state.
Used setState() instead of scheduleBuild().
Used an O(N) algorithm for mine laying instead of the previous potentially-never-ending algorithm.
Moved the listener on the cells to the app, so that the logic survives a rebuild.
Various other minor changes.
2015-07-21 17:24:51 -07:00
Collin Jackson 1f768ce2ba First pass at adding meal tracking to fitness app 2015-07-21 17:13:00 -07:00
Viktor Lidholt 972417f54e Merge branch 'master' of github.com:domokit/sky_engine 2015-07-21 16:46:14 -07:00
Viktor Lidholt 271812259b Fixes issues in demo game and adds heads up display 2015-07-21 16:45:53 -07:00