History log of /sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ResizeGesture.java
Revision Date Author Comments
85e4a1a9dd133abb879ec211ce8dd385004edf22 08-Aug-2012 Xavier Ducrohet <xav@android.com> Refactor common.jar

Move resources and com.android.util.Pair into layoutlib_api
where they belong since layoutlib depends on them and we need
to control the API.

Made a copy of Pair to stay in common.jar but moved it to
com.android.utils.Pair (the one in com.android.util.Pair is
marked as deprecated to prevent usage where applicable).

Also moved XmlUtil and PositionXmlParser to com.android.utils
to match Pair.

Change-Id: I21d7057d3f2ce604f86a3bb1fa3c130948c93b89
bf9db3ba5053c8f22a07ee748b2cb41d374d8642 24-Aug-2011 Tor Norbye <tnorbye@google.com> Use GridLayout state to determine exact row and column boundaries

This changeset updates the GridLayout support to consider the state of
a rendered GridLayout when deciding where the rows and columns
are. This information is already available in the GridLayout object,
so if one is provided use that data rather than inferring it from the
bounds of the views in each row and column.

This required changing the view rules API a bit to pass the view
objects in to the key entry points (drawing selection, drag & drop and
resize).

Change-Id: If8484f7f7181c65d0a2fdf629ffd515edd05448b
1c9f2f2274a757006035f1031cf3117c1cd7632e 12-Jul-2011 Tor Norbye <tnorbye@google.com> Fix resize feedback for cell spanning mode

When resizing in a GridLayout you can toggle whether you are resizing
the widget or the cell bounds with the Shift key (and the resize
feedback tells you this).

However, the drawn resize feedback was always showing the widget
bounds. This CL fixes this such that when you are resizing the cell
bounds, the current cell bounds are displayed instead.

(Also contains a simple fix to ensure feedback is drawn when you
click and hold (without dragging yet) on a resize handle.)

Change-Id: I7cf24f4508aa5bbafd45f36b13be41e66ecbc6cc
8f6e2fc89af2a75e05608d9ee1c648171ea47d83 11-Jul-2011 Tor Norbye <tnorbye@google.com> Add resize feedback tooltip

This changeset adds a "tooltip" during resize operations close to the
mouse cursor which displays feedback about the current resize
dimensions.

The feedback window is similar in appearance to a tooltip, but unlike
SWT tooltips it moves with the cursor and updates the text
dynamically, and appears immediately rather than being tied to mouse
motion timeouts. It is also partially translucent and uses a slightly
smaller font.

Change-Id: I6b663510f078f325d2f7b168c887aeff14de31b8
80d9301c2e874b29889c41adb0623666cf534fa0 10-Apr-2011 Tor Norbye <tnorbye@google.com> Resize & Guideline Support

RelativeLayout now has both drop/move and resize guidelines, and
existing constraints are visualized for the selection.

LinearLayout resizing now uses weights to change the size of nodes
rather than setting width/height.

All resize operations offer guidelines to snap to their "wrap_content"
size.

Various bug fixes in related areas as well.

Change-Id: I817e34c6e67ce61cfb137eb067076d91f69f99e9
429ae88878cf781753d8261d350ad89fe5864169 07-Apr-2011 Tor Norbye <tnorbye@google.com> Add Resize Support to the Layout Editor

This changeset adds "resizing" support to the layout editor.

First, the normal selection overlay is replaced with a selection
rectangle which also has "selection handles" in the corners and in the
middle of each edge. Moving the cursor over one of the selection
handle will show a directional resize cursor, and dragging the handle
will initiate a new resizing gesture. (This also made it possible to
remove the selection fill we've used until now, so the layout editor
will "interfere" less with the visual look of the layout.)

During the resizing operation, the current size is displayed in the
Eclipse status bar.

The resizability of widgets is determined by metadata, so for example
a ZoomControls widget is not resizable, a rating bar is only
horizontally resizable, a TableRow is only vertically resizable, and
most widgets are resizable in any direction.

The parent layout is involved in the resizing operation. Currently,
the resizing gestures will only update the width and height properties
(except for absolute layout, which will also set the x and y
properties if you are dragging a left or top edge). In a follow up
changeset this will be extended to for example make RelativeLayout
allow resize dragging to snap to new edges and the resize will be
applied as a set of new constraints on the "resized" widget. Thus,
you'll be able to drag the right hand side of a widget and drag it
over to attach to some other widget or edge, independent of what the
left edge or vertical edges are bound to.

This changeset also adds the ability for ViewRules to provide a
message or error message back to the IDE during a drag or resize
operation. For resizing this is used to display the new size. However,
it is now also used to display more useful messages in a couple of
older scenarios:
* Attempting to drag anything into a ListView will display a message
that AdapterViews much be configured via Java code
* Attempting to drag anything into or within an AbsoluteLayout will
warn that AbsoluteLayouts are deprecated.

Note that resizing will currently set the size to specific pixel (dip)
sizes. In the next changeset I will add guidelines which (in addition
to those described for RelativeLayout above) will add guidelines for
significant sizes such as the parent size, the preferred
(wrap_content) size of the widget, and possibly other hardcoded sizes
in the same layout.

Change-Id: Ie4f3367e81b24259a106c649c944008f4a3d31ec