400 Commits

Author SHA1 Message Date
Adam Barth
bf260f98e3 Add a compositing step to the lifecycle
Now we have the ability to draw multiple PictureLayers. We still squash all the
pictures together into a single SkPicture for simplicity. In the future, we'll
submit them to C++ separately and composite them on the GPU thread.
2015-08-13 16:31:45 -07:00
Adam Barth
7cba729110 Switch painting over to using PictureLayer
Currently we have a single PictureLayer that everyone draws into. A future
patch will teach the system to use multiple PictureLayers.
2015-08-13 14:24:29 -07:00
Adam Barth
be8454073a Rename createsNewDisplayList to requiresCompositing
This patch prepares for introducing the compositing system by repurposing the
relevant parts of the createsNewDisplayList system. This patch also removes the
no-longer-relevant parts of that system.
2015-08-13 12:43:39 -07:00
Adam Barth
45be4c6faf Kill sky_server by port instead of pid
We seem to have trouble killing sky_server by its pid. Instead, lets try
killing it by looking up which process is listening on the sky_server port.
2015-08-13 12:28:53 -07:00
mpcomplete
dc304b42a6 Merge pull request #592 from mpcomplete/animation.asserts
Fix common asserts in animation API.
2015-08-13 13:55:28 -04:00
Adam Barth
c80603cf0e Add PaintingContext which has-a sky.Canvas instead of is-a sky.Canvas
We'll need this for compositing because we need to switch out the sky.Canvas
when we switch compositing layers.
2015-08-13 10:18:33 -07:00
Matt Perry
8a7293170e Fix common asserts in animation API.
1. We would assert if you tried to start an animation from within an
animation status callback. This is a common pattern, so I fixed this
assert (in Ticker._tick).
2. We would assert for animations with duration under a millisecond.
Fixed.

Also removed the workarounds assocated with #1.
2015-08-13 13:18:25 -04:00
Adam Barth
7295563d7a Rev pub package 2015-08-13 09:20:16 -07:00
Adam Barth
12586a6343 RenderBox.hitTest should do the bounds check
Previously we were doing the bounds testing for hit tests in the parent, but
that doesn't work if the child paints at a location other than 0.0, 0.0. Now we
do the bounds check in the child. This also simplifies Scaffold's hit testing.

Fixes #558
2015-08-12 17:46:10 -07:00
Adam Barth
b4e3f8591b Rev pub package 2015-08-12 14:46:59 -07:00
Adam Barth
0fcf1912ae Update README.md 2015-08-12 09:18:32 -07:00
Adam Barth
70869f93f0 Require a new version of sky_tools 2015-08-12 09:12:32 -07:00
Hans Muller
16ffdc67a6 Merge pull request #572 from HansMuller/ensure-visible
Adds ensureWidgetIsVisible() function to scrollable.dart
2015-08-11 16:51:24 -07:00
Andrew Wilson
a1249ad2c7 Maximum bounds for the mimic in the overlay can now be specified. 2015-08-11 16:50:19 -07:00
Hans Muller
9e9d845b1f Adds ensureWidgetIsVisible() function to scrollable.dart
Set the scrollOffset of a widget's Scrollable ancestor so that the
widget is centered within the scrollable. A future CL will add
support for specifying exactly where the widget appears. The scroll
can be animated by specifying the animation: parameter.

Changed the duration Scrollable.scrollTo() parameter from a Duration
to an AnimationPerformance so that one can configure all aspects of
the animation. The caller may also listen to the animation to schedule
other work while it updates or when its status changes.
complete
2015-08-11 16:49:48 -07:00
Eric Seidel
8417fb62da Merge pull request #571 from eseidelGoogle/splash
Attempt to make our splashes closer to other Android apps
2015-08-11 15:06:51 -07:00
Eric Seidel
cd5715bbf3 Attempt to make our splashes closer to other Android apps
And also Material Design of course.

@abarth
2015-08-11 14:56:36 -07:00
Adam Barth
5bbf0d8967 Merge pull request #570 from abarth/paint_once
Don't paint twice
2015-08-11 14:54:48 -07:00
Adam Barth
88eba9150f Don't paint twice
In refactoring the way we generate the SkPicture, I accidentially made us
generate the SkPicture twice. This CL causes us to generate it only once.
2015-08-11 14:38:49 -07:00
Matt Perry
3d9f523179 Scaffold: animate the FloatingActionButton with the SnackBar.
This introduces the concept of an Anchor, which you can use to link
transitions together. I've used this in the Fitness and Stocks apps to
link the FAB and SnackBar to animate together by sharing the
SlideTransition.

I also fixed the Scaffold hit testing code to apply sub-widget
transforms, so it works with Transformed nodes.
2015-08-11 17:21:20 -04:00
Adam Barth
eee90d0dd6 Merge pull request #560 from afandria/patch-1
Update README.md
2015-08-11 13:59:00 -07:00
Eric Seidel
441fe4d491 Fix crash when hitting "enter" key on keyboard during entry
Now it wont crash on save, but it still doesn't display
the error message in a snackbar and this also doesn't
wire up the enter/go key to actually do anything.

We'll need to implement performEditorAction on our
InputConnection implementation to catch this key and
pass it along to dart.

Our Input control needs to get more powerful to handle things
like this, including filtering of input.

The code was crashing by triggering a bug in the SnackBar
which didn't assert for actions, but crashed when they
were not null.

Partial fix for https://github.com/domokit/sky_engine/issues/543

@abarth
2015-08-11 12:27:54 -07:00
Alex Fandrianto
195fe22a31 Update README.md
Added missing :
2015-08-11 11:59:25 -07:00
Adam Barth
a96f59516c Rev pub package 2015-08-11 10:51:48 -07:00
Adam Barth
c3e48c53d9 Merge pull request #553 from abarth/immersive
Add support for immersive mode on Android
2015-08-11 10:37:41 -07:00
Adam Barth
e770b9da52 Merge pull request #552 from abarth/fix_image_layout
Images in Stocks drawer layout at crazy sizes
2015-08-11 10:15:45 -07:00
Adam Barth
345f017640 Add support for immersive mode on Android
Fixes #512
2015-08-11 10:13:34 -07:00
Adam Barth
ae9f170243 Images in Stocks drawer layout at crazy sizes
Now that we get sky.Image callbacks synchronously, we were actually figuring in
the width and height of images the second time the drawer opened in the Stocks
app. That exposed a bug in our RenderImage layout code whereby it would ignore
the _width and _height properties when the image was non-null.
2015-08-11 09:52:22 -07:00
Adam Barth
375c24772e Remove weak handle from sky.Paint
This patch converts sky.Paint to be a pure Dart object, which means we don't
need to open a weak handle to sky.Paint. Avoiding the weak handle reduces the
amount of weak handle callbacks we need to process at the end of GC and
therefore reduces jank.
2015-08-11 09:37:20 -07:00
Adam Barth
2701b469cf Merge pull request #545 from abarth/image_resource
Use ImageResource instead of Future<sky.Image>
2015-08-11 08:35:49 -07:00
Hans Muller
d2d9ae134d The IgnorePointer class enables one to cut a widget subtree off from pointer events. This is useful when a sibling should not shield pointer events from overlapping siblings below it.
Added a ScrollListener listener to Scrollable. The ScrollListener runs each time the Scrollable's scrollOffset changes. This can be used to keep overlay widgets in sync with a Scrollable below them.

Removed the Scrollable ScrollClient API. It was no longer used and was clumsy to use as a ScrollListener.

Added global function findScrollableAncestor() to scrollable.dart.

Added examples/widgets/overlay_geometry.dart. The app's Scaffold is contained by a Stack. The Stack is used to display green overlay "Markers" at the corners of the most recently selected list item and where the corresponding tap occurred. The app uses widget.localToGlobal() to compute the global overlay positions of the markers. The ScrollListener is used to keep the markers' positions up to date.
2015-08-11 08:29:30 -07:00
Adam Barth
9f228349e9 Use ImageResource instead of Future<sky.Image>
Using ImageResource solves two problems:

1) Listeners can be notified synchronously when the sky.Image is already
   available. This change removes flash of 0x0 layout when moving an
   already-cached image around in the render tree.

2) In the future, when we support animated images, we can notify listeners
   multiple times whenever a new image is available.
2015-08-10 20:43:32 -07:00
Adam Barth
c59f418fd6 Merge pull request #530 from abarth/move_scale
Simplify SkPicture
2015-08-10 15:45:00 -07:00
Adam Barth
e3d9ea67da Simplify SkPicture
This patch simplifies the SkPicture we generate for Skia. Instead of drawing
everything into a nested SkPicture, we now draw everything into the top-level
picture, which requires us to apply the device scale factor in Dart.
2015-08-10 15:12:13 -07:00
Eric Seidel
01255a6417 Make it possible to save/load fitness measurements
This required me wrapping the new Activity APIs
as well as adding the missing pubspec.yaml

@abarth
2015-08-10 14:29:22 -07:00
mpcomplete
03403d082a Merge pull request #520 from mpcomplete/tabs.indicator
Fix tab indicator animation so it doesn't snap to the previous tab.
2015-08-10 16:57:03 -04:00
Adam Barth
dd51bd5326 Add the ability to color filter background images 2015-08-10 13:30:52 -07:00
Matt Perry
cf71fecf9d Fix tab indicator animation so it doesn't snap to the previous tab.
If you tap multiple tabs in a row, the tab animation used to snap to the
last selected tab when starting a new animation. Fix that.

Also use the BuilderTransition so we don't have to rebuild the tab bar
every frame.
2015-08-10 16:22:57 -04:00
Adam Barth
3e85649cfd Merge pull request #519 from abarth/optimize_clips
Optimize circular clips slightly
2015-08-10 12:10:44 -07:00
Adam Barth
ec0bccfb5d Optimize circular clips slightly
This patch avoids creating weak references on every paint call by caching the
Path object between paints.
2015-08-10 11:18:44 -07:00
Matt Perry
de7d8efc47 Get rid of the Direction parameter for animation Forces.
Just infer it from the sign of the velocity. That's what odeon does.
2015-08-10 13:24:52 -04:00
Ian Fischer
8e11dcb5a7 Merge pull request #510 from iansf/move_examples
Move examples to the root
2015-08-07 18:32:18 -07:00
Adam Barth
2b22c12128 Merge pull request #514 from apwilson/image_assert
Fix asserts related to image drawing.
2015-08-07 18:21:05 -07:00
Adam Barth
bcd0d8fe9b Remove the flicker from MimicOverlay
There were two problems:

1) When starting the mimic, we put up a bad frame because although we set the
   `begin` value of the animation, we were building using the current `value`,
   which hadn't been updated.

2) When stoping the mimic, we'd dirty a component during didUnmount, which
   wouldn't get cleaned until the next frame. Now we're sure to clean all the
   components before leaving flushBuild.
2015-08-07 17:06:41 -07:00
Ian Fischer
d44ed7dfc3 Move example out of sky/packages to //examples 2015-08-07 17:04:50 -07:00
Andrew Wilson
440a63a5bb Fix assert's related to image drawing. 2015-08-07 17:00:56 -07:00
Adam Barth
66e64023d8 Rev sky packages 2015-08-07 15:29:00 -07:00
Adam Barth
68565eb317 Use localToGlobal and globalToLocal in MimicOverlay
Also, make RenderStack support negative positions with clipping so that we can
expand objects that are partially offscreen.
2015-08-07 14:47:06 -07:00
Ian Fischer
19fa9ae2d6 Merge pull request #506 from iansf/demo_launcher_pubspec
First example pubspec
2015-08-07 14:28:53 -07:00
Ian Fischer
7d3065679f Rename build_path to build-path. 2015-08-07 14:27:23 -07:00