Tweaked the layout in Scaffold a little: the Scaffold
accounts for the (Android) notification bar's height,
instead of the ToolBar. I think it would be best if
moving the app below the notification area were handled
at a lower level. Doing it in Scaffold seemed OK for the
moment, since one could put a ToolBar component anywhere
in an app.
Closes#208R=ianh@google.com
Review URL: https://codereview.chromium.org/1171173003.
This also removes one bit of magic to make it more obvious what on is
going on during a sync, which should hopefully help.
Components have to decide if they support being stateful or not. If
they do, then they must implement syncFields() and have mutable
fields; if they don't, then they must have final fields. This isn't
particularly enforced, though.
This also renames _willSync() to _retainStatefulNodeIfPossible(), for
clarity, and fixes some minor style issues and one typo that was
breaking the drawer.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1174023003
Previously, the ink splashes would disappear immediately because the button
highlight would change the structure of the component hierarchy and we weren't
smart enough to retain the underlying RenderInkSplash. This CL is a point fix
for that issue by avoiding changing the structure of the component hierarchy. A
more complete fix would be to make Container smarter about how it syncs its
subcomponents.
R=eseidel@chromium.org, ianh@google.com
Review URL: https://codereview.chromium.org/1168323003.
This CL replaces the (non-working) components2 InkWell with some code based on
the ink_well example. There are at least two issues with the implementation:
1) The ink splash always starts at the center of the well because we don't have
a facility for converting from global to local coordinates, which means we
can't tell where the tap occurred in the local coordinates we need to use
for painting.
2) When used inside a MenuItem, the in splash disappears shortly after
starting, presumably because the button starts highlighting, which causes a
component rebuild and somehow we lose the RenderInkWell instance.
I plan to address these issues in subsequent CLs.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1172033003.
- constructors first
- have either a blank line at the top and bottom of each class, or no blank line in either place (it's still inconsistent about which we should do)
- hide clamp()
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1172173002
The popup menu in the stocks app is supposed to size its width to the max
intrinsic width of the menu. This CL teaches it how to do that.
It's a shame that we need to ceilToDouble the output of RenderParagraph. If we
don't do that, we run into floating point layout trouble and the menu triggers
a line break. The correct fix is to do layout in fixed point.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1168113005
The popup menu is displayed in the wrong location with the wrong width, but it
does draw. I've also removed the checkbox because the flex container was
causing me trouble. I'll add it back in a later CL.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1166153002
This CL is the first step towards getting PopupMenuItem working in fn2. We
introduce the ability to add a minWidth to a Container by creating a
RenderConstrainedBox class to apply the new constraints.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1155683011
This includes making SizedBox default to infinite size, and making
Container default to containing one infinite-sized SizedBox. That way,
you can use an empty Container as a spacer in a flex box.
The rendering doesn't quite work, because of a bug in flex whereby it
doesn't shrink-wrap its contents in the cross-direction, it fills the
parent. Collin is on that.
R=jackson@google.com
Review URL: https://codereview.chromium.org/1163633003
This makes debugging the render tree a lot easier. Just print the node
you care about, and you get an indented tree view of its subtree,
including settings. New subclasses should implement the new virtual
method debugDescribeSettings() to expose new settings.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1157993005
This CL makes FixedHeightScrollable able to measure heights. In the DOM-based
version, FixedHeightScrollable forced a synchronous layout in a microtask in
order to measure the size of itself and its children. In the DOM-less version,
we now require the subclass to tell us the item height and we measure our own
height using a layout callback.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1161063005
The root cause of the crash was threefold:
- you can't enumerate enums, in dart; you have to enumerate their values.
- RenderNodeWrapper was trying to call remove(child.root) on its root, but that's
not something that all RenderNodes have
- when a RenderNode was deparented, its relayoutSubtreeRoot wasn't removed, so
the node ended up in an inconsistent state regarding its parent tree
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1151573020
Also, make the scaffold code more generic (with slots in a map,
instead of dedicated members for each slot).
This may eventually benefit from being split into a general
"multislot" superclass and a scaffold-specific subclass, but for now
it'll do.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1152163007
This CL is a first pass at implementing container in fn2. In this approach,
Container is a Component that builds a number of RenderNodeWrappers depending
on what is needed.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1158983005