OSDN Git Service

android-x86/sdk.git
13 years agoRelativeLayout: Assign ids dynamically, handle multi-drag, bugs
Tor Norbye [Fri, 10 Jun 2011 00:44:03 +0000 (17:44 -0700)]
RelativeLayout: Assign ids dynamically, handle multi-drag, bugs

This CL fixes three issues with the new relative layout interaction:

(1) Assign ids dynamically. Before this changeset you couldn't attach
    to a node which does not have an @id attribute, since layout
    params need to name the constraint by id.

    This changeset changes this such that you can attach to any
    arbitrary edge, and when you commit the drag, a unique id is
    generated on the fly and assigned to the node.

(2) Handle dragging multiple nodes at the same time. The new
    constraints code was unconditionally applying the same constraints
    to all the dragged nodes, which meant they ended up on top of each
    other. This fixes things such that the first node is assigned the
    new constraints, and then all subsequent nodes are attached one
    next to the other, in a direction depending on which edge you
    attached to (e.g. attaching on the right will arrange the siblings
    towards the left out from the edge.)

(3) Fix a bug in the code to detect and prevent cycles.

Change-Id: I157d45e117d3229f285870517b85ed902607b966

13 years agomerge from tools_r12
The Android Open-Source Project [Fri, 10 Jun 2011 22:05:58 +0000 (15:05 -0700)]
merge from tools_r12

Change-Id: Ie521b9c9d5d89663d827ef958aebeea89a4b1b79

13 years agoMerge "CherryPick 8f21dc3e from master to r12. do not merge." into tools_r12
Xavier Ducrohet [Fri, 10 Jun 2011 21:30:19 +0000 (14:30 -0700)]
Merge "CherryPick 8f21dc3e from master to r12. do not merge." into tools_r12

13 years agoMerge "CherryPick aef49b24 from master to r12. do not merge." into tools_r12
Xavier Ducrohet [Fri, 10 Jun 2011 21:30:11 +0000 (14:30 -0700)]
Merge "CherryPick aef49b24 from master to r12. do not merge." into tools_r12

13 years agoMerge "CherryPick 28978f45 from master to r12. do not merge." into tools_r12
Xavier Ducrohet [Fri, 10 Jun 2011 21:30:04 +0000 (14:30 -0700)]
Merge "CherryPick 28978f45 from master to r12. do not merge." into tools_r12

13 years agoCherryPick 8f21dc3e from master to r12. do not merge.
Tor Norbye [Fri, 10 Jun 2011 20:41:51 +0000 (13:41 -0700)]
CherryPick 8f21dc3e from master to r12. do not merge.

Workaround view info cookie bug

This changeset works around the case where a ViewInfo cookie is
identical to its parent. This is for example the case for a
ZoomControls widget, where the child views have MergeCookies whole
value points to the parent ZoomControl.

Change-Id: I6c85dab318eb5b5a4e5dd95d4c7ead61c81f435d

13 years agoCherryPick aef49b24 from master to r12. do not merge.
Tor Norbye [Fri, 10 Jun 2011 20:58:35 +0000 (13:58 -0700)]
CherryPick aef49b24 from master to r12. do not merge.

Fix proguard template to avoid shrinking XML-only references

See 16384: ProGuard template generated by the ADT is flawed

Change-Id: Ibf4510cc4ad9aafec2712326053e80d80599add4

13 years agoMerge "Workaround view info cookie bug"
Tor Norbye [Fri, 10 Jun 2011 21:27:18 +0000 (14:27 -0700)]
Merge "Workaround view info cookie bug"

13 years agoMerge "Fix proguard template to avoid shrinking XML-only references"
Tor Norbye [Fri, 10 Jun 2011 21:26:31 +0000 (14:26 -0700)]
Merge "Fix proguard template to avoid shrinking XML-only references"

13 years agoCherryPick 28978f45 from master to r12. do not merge.
Xavier Ducrohet [Fri, 10 Jun 2011 21:22:13 +0000 (14:22 -0700)]
CherryPick 28978f45 from master to r12. do not merge.

Make String-based hw prop not recognized.

Currently all those strings aren't set to be viewed by the user
in the AVD UI so we ignore them.
In the future we should use a specific flag to ignore some (like
avd.name) and allow others.

Change-Id: I4567dfd9ebfec1f09ab027019a8302e442962630

13 years agoMerge "Make String-based hw prop not recognized."
Xavier Ducrohet [Fri, 10 Jun 2011 21:24:54 +0000 (14:24 -0700)]
Merge "Make String-based hw prop not recognized."

13 years agoMake String-based hw prop not recognized.
Xavier Ducrohet [Fri, 10 Jun 2011 21:22:13 +0000 (14:22 -0700)]
Make String-based hw prop not recognized.

Currently all those strings aren't set to be viewed by the user
in the AVD UI so we ignore them.
In the future we should use a specific flag to ignore some (like
avd.name) and allow others.

Change-Id: Icab59bcc0b97c14fa14b786c737457434b7f51ac

13 years agoMerge "Cherrypick e2bdf98b from master to r12. do not merge." into tools_r12
Xavier Ducrohet [Fri, 10 Jun 2011 21:18:29 +0000 (14:18 -0700)]
Merge "Cherrypick e2bdf98b from master to r12. do not merge." into tools_r12

13 years agoMerge "CherryPick ce54b194 from master into r12. do not merge." into tools_r12
Xavier Ducrohet [Fri, 10 Jun 2011 21:18:25 +0000 (14:18 -0700)]
Merge "CherryPick ce54b194 from master into r12. do not merge." into tools_r12

13 years agoCherrypick e2bdf98b from master to r12. do not merge.
Raphael Moll [Fri, 10 Jun 2011 20:47:39 +0000 (22:47 +0200)]
Cherrypick e2bdf98b from master to r12. do not merge.

Fix NPE on edit unknown AVD hardware property.

Change-Id: I93d2348622b8ccd320c76e40c508bf15ff96ff31

13 years agoCherryPick ce54b194 from master into r12. do not merge.
Raphael Moll [Fri, 10 Jun 2011 20:22:34 +0000 (22:22 +0200)]
CherryPick ce54b194 from master into r12. do not merge.

Fix AVD detail not displaying correctly.

Change-Id: If6bf328e38cc1e57bdedf060ea0a27d12b41c487

13 years agoFix proguard template to avoid shrinking XML-only references
Tor Norbye [Fri, 10 Jun 2011 20:58:35 +0000 (13:58 -0700)]
Fix proguard template to avoid shrinking XML-only references

See 16384: ProGuard template generated by the ADT is flawed

Change-Id: I6ebbcf059bbee8c485747dcee55f4ecfa14b6831

13 years agoMerge "Fix NPE on edit unknown AVD hardware property."
Xavier Ducrohet [Fri, 10 Jun 2011 20:55:12 +0000 (13:55 -0700)]
Merge "Fix NPE on edit unknown AVD hardware property."

13 years agoFix NPE on edit unknown AVD hardware property.
Raphael Moll [Fri, 10 Jun 2011 20:47:39 +0000 (22:47 +0200)]
Fix NPE on edit unknown AVD hardware property.

Change-Id: Ie79eb0bbfef17dd114b2002bbf5414d375eeb499

13 years agoWorkaround view info cookie bug
Tor Norbye [Fri, 10 Jun 2011 20:41:51 +0000 (13:41 -0700)]
Workaround view info cookie bug

This changeset works around the case where a ViewInfo cookie is
identical to its parent. This is for example the case for a
ZoomControls widget, where the child views have MergeCookies whole
value points to the parent ZoomControl.

Change-Id: Ie0eb62750fba6eeaa7241edce68e05f853e08a75

13 years agoMerge "Fix AVD detail not displaying correctly."
Xavier Ducrohet [Fri, 10 Jun 2011 20:27:12 +0000 (13:27 -0700)]
Merge "Fix AVD detail not displaying correctly."

13 years agoFix AVD detail not displaying correctly.
Raphael Moll [Fri, 10 Jun 2011 20:22:34 +0000 (22:22 +0200)]
Fix AVD detail not displaying correctly.

Change-Id: I4ecf1c25c9f9defe28b8896332301c15b343c056

13 years agoMerge "Fix refresh issue in the resource chooser"
Tor Norbye [Fri, 10 Jun 2011 18:47:39 +0000 (11:47 -0700)]
Merge "Fix refresh issue in the resource chooser"

13 years agoMerge "Fix excludes in the change layout/widget refactoring dialogs"
Tor Norbye [Fri, 10 Jun 2011 18:47:32 +0000 (11:47 -0700)]
Merge "Fix excludes in the change layout/widget refactoring dialogs"

13 years agoMerge "Fix GestureOverlayView handling"
Tor Norbye [Fri, 10 Jun 2011 18:47:21 +0000 (11:47 -0700)]
Merge "Fix GestureOverlayView handling"

13 years agoFix GestureOverlayView handling
Tor Norbye [Fri, 10 Jun 2011 18:29:58 +0000 (11:29 -0700)]
Fix GestureOverlayView handling

This CL fixes a number of problems related to the GestureOverlayView.

The first big problem was that GestureOverlayView lives in the
android.gesture package, which is not one of the special builtin
packages you can omit when specifying the element in layout XML
files. This CL both stores a full path in the descriptor XML name,
which fixes tag-to-descriptor lookup (without this we were showing the
wrong icon and missing vital attributes in completion), and handles
scenarios where the full path has to be used.

The second problem was that the descriptor metadata listed
GestureOverlayView as a "view" rather than a "layout", which meant
that it was missing information about children (which meant you
couldn't drop into it), and it was missing layout params (which meant
children couldn't be assigned attributes like layout_width and
layout_height).

Also tweak selection handling for gesture views.

There are a number of places where we need to go from a class name to
a view descriptor; these are now centralized in a utility method and
sped up with a map lookup.

(Issues fixed: #17541, #17543)

Change-Id: I67c450f28eab07b3575e510420b7faf4410085e3

13 years agoFix refresh issue in the resource chooser
Tor Norbye [Fri, 10 Jun 2011 18:19:59 +0000 (11:19 -0700)]
Fix refresh issue in the resource chooser

When you switch between Framework and Project resources in the
resource chooser, the icon preview would not get updated since
apparently no selection event is fired. This fixes that issue.

Change-Id: I431ba3be4fbc01594232deb1a2f3949894cd8899

13 years agoFix excludes in the change layout/widget refactoring dialogs
Tor Norbye [Fri, 10 Jun 2011 18:17:16 +0000 (11:17 -0700)]
Fix excludes in the change layout/widget refactoring dialogs

Change-Id: Ib1564f7528d36182071427b795f9e15da64ffc7a

13 years agoMerge "Fix build"
Tor Norbye [Fri, 10 Jun 2011 00:53:39 +0000 (17:53 -0700)]
Merge "Fix build"

13 years agoFix build
Tor Norbye [Fri, 10 Jun 2011 00:52:53 +0000 (17:52 -0700)]
Fix build

Change-Id: Ie72e6f7b2c66dd25066b3c53b8d59ca4e2130e9a

13 years agoMerge "Disable PostComp in ADT except on Export or Debug"
Josiah Gaskin [Fri, 10 Jun 2011 00:25:01 +0000 (17:25 -0700)]
Merge "Disable PostComp in ADT except on Export or Debug"

13 years agoMerge "Revert ScreenLayoutSize to ScreenSize."
Xavier Ducrohet [Fri, 10 Jun 2011 00:23:00 +0000 (17:23 -0700)]
Merge "Revert ScreenLayoutSize to ScreenSize."

13 years agoDisable PostComp in ADT except on Export or Debug
Josiah Gaskin [Wed, 8 Jun 2011 01:05:42 +0000 (18:05 -0700)]
Disable PostComp in ADT except on Export or Debug

This patch adds a check in PostCompilerBuilder so if a flag is
not explicitly set (as is done by ExportHelper and Launch) then
it will skip and not do packaging. This should speed up the incremental
build on file save at the cost of slightly longer builds when pushing
to the debugger.

Change-Id: I2993f91a9b53e767e77da82de61b2699dd1127a4

13 years agoRevert ScreenLayoutSize to ScreenSize.
Xavier Ducrohet [Fri, 10 Jun 2011 00:18:41 +0000 (17:18 -0700)]
Revert ScreenLayoutSize to ScreenSize.

I hadn't noticed that LayoutLib actually uses ScrenSize
through the tools-common-prebuilt.jar, so this API is (somewhat*)
frozen.

* Somewhat because LayoutLib.jar actually only uses Density and
ScreenSize but not the other enums (yet?) so the rename of DockMode
is not a problem.

Change-Id: Ida3360b0111abd96d2a27c16833b282706774fb6

13 years agoMerge "Renamed some resource enum/qualifiers to be more consistent with the platform."
Xavier Ducrohet [Thu, 9 Jun 2011 23:21:43 +0000 (16:21 -0700)]
Merge "Renamed some resource enum/qualifiers to be more consistent with the platform."

13 years agoRenamed some resource enum/qualifiers to be more consistent with the platform.
Xavier Ducrohet [Thu, 9 Jun 2011 22:42:31 +0000 (15:42 -0700)]
Renamed some resource enum/qualifiers to be more consistent with the platform.

Change-Id: I9c5ea5183e115582e0b805ca3ec75aad70e4a65c

13 years agoMerge "Add support for the new width/height resource qualifiers."
Xavier Ducrohet [Thu, 9 Jun 2011 21:34:49 +0000 (14:34 -0700)]
Merge "Add support for the new width/height resource qualifiers."

13 years agoAdd support for the new width/height resource qualifiers.
Xavier Ducrohet [Thu, 9 Jun 2011 21:07:57 +0000 (14:07 -0700)]
Add support for the new width/height resource qualifiers.

Also add Television to the dock mode (which is really UI Mode).

Change-Id: I97e3fbea1806a32d8267d8e462211add2b122ed0

13 years agoMerge "Fix various warnings"
Tor Norbye [Thu, 9 Jun 2011 21:19:23 +0000 (14:19 -0700)]
Merge "Fix various warnings"

13 years agoFix various warnings
Tor Norbye [Thu, 9 Jun 2011 18:46:40 +0000 (11:46 -0700)]
Fix various warnings

I ran the latest version of findbugs on our codebase and fixed some
(not all!) of the warnings.

I also ran with Eclipse 3.7 RC3 and updated our compiler warning
settings for the new warnings that are available.

I also fixed some DOS line endings in some files (formatted with CRLF
instead of LF).

Change-Id: I9a9d34a9b60f2cb609245793815d96a4587007b0

13 years agoMerge "Hide ClassNotFoundExceptions from the error console."
Tor Norbye [Thu, 9 Jun 2011 18:17:41 +0000 (11:17 -0700)]
Merge "Hide ClassNotFoundExceptions from the error console."

13 years agoMerge "Suggest similar class names or missing pkgs in the error console"
Tor Norbye [Thu, 9 Jun 2011 18:17:31 +0000 (11:17 -0700)]
Merge "Suggest similar class names or missing pkgs in the error console"

13 years agoHide ClassNotFoundExceptions from the error console.
Tor Norbye [Thu, 9 Jun 2011 00:40:07 +0000 (17:40 -0700)]
Hide ClassNotFoundExceptions from the error console.

When a class is not found during rendering, the name of the class (all
by itself, with no other explanation) will show up in the error
console. That's because we include all the render errors there.

However, class loading failures is handled specially in the project
callback, where the names of missing and broken classes are recorded
and later presented in a special way with hyperlinks. Therefore, we
don't need this first error listing of the missing class, especially
since it's confusing since it just lists the class name all by itself.

This changeset simply hides ClassNotFoundExceptions from the error
console since they will be listed in a cleaner way by the separate
mechanism.

NOTE: The exception *will* go to the IDE log as before, it just won't
appear in the user-visible error console shown below the layout
editor.

Change-Id: I34e90ba26ee77f8b3c56f528aaaf7fddca6620ad

13 years agoSuggest similar class names or missing pkgs in the error console
Tor Norbye [Thu, 9 Jun 2011 00:19:20 +0000 (17:19 -0700)]
Suggest similar class names or missing pkgs in the error console

If the layout XML file contains typos, the rendering will fail and the
canvas will list the missing classes along with hyperlinks to create a
new class, configure the build path etc.

This changeset looks for "typos" in the view names and if it finds a
similar real view class, either among the Android views or among the
custom views in the current project, then it will add a hyperlink
suggestion to fix the XML by editing the name to the correct spelling.

It also handles the scenario where you have typed in a custom view
class name correctly, but have forgotten to include its package.

In a followup changeset this functionality will be available from the
XML editing quick assistant as well.

Change-Id: Iaefd3f503795e25e6eb38353c60c645061d4814e

13 years agoMerge "Code completion improvements inside custom views"
Tor Norbye [Wed, 8 Jun 2011 21:23:02 +0000 (14:23 -0700)]
Merge "Code completion improvements inside custom views"

13 years agoMerge "Improve error handling for missing and broken custom view classes"
Tor Norbye [Wed, 8 Jun 2011 21:07:10 +0000 (14:07 -0700)]
Merge "Improve error handling for missing and broken custom view classes"

13 years agoMerge "Custom sort property sheet categories"
Tor Norbye [Wed, 8 Jun 2011 21:07:03 +0000 (14:07 -0700)]
Merge "Custom sort property sheet categories"

13 years agoCode completion improvements inside custom views
Tor Norbye [Fri, 3 Jun 2011 16:41:54 +0000 (09:41 -0700)]
Code completion improvements inside custom views

This CL fixes several issues when using code completion inside a tag
that is a custom view. In that case we don't have a valid descriptor
which specifies the allowable children, which meant completing inside
any of the children, even if they are standard Android widgets, would
not locate names and attributes. This fixes that, along with handling
dots in tag names which caused other code completion problems.

Change-Id: If0f007322c6aa00363ab32baf6191a3d3ffb9883

13 years agoImprove error handling for missing and broken custom view classes
Tor Norbye [Wed, 8 Jun 2011 17:17:40 +0000 (10:17 -0700)]
Improve error handling for missing and broken custom view classes

When a view class cannot be found during rendering, the error log
lists the class as missing, and presents the class as a
hyperlink. Clicking the link will open the New Class wizard.

This CL changes this such that there are multiple links instead:

- "Fix Build Path": This opens the Java Build Path preference page in
  the Options dialog for the current project where you can fix the
  build path of the project, since a more common source of missing
  classes is a problem with the class path.

- "Edit XML": This switches to the XML tab where you can edit the name
  of the custom view tag: A "missing" view is often a typo in the view
  name

- "Create Class": This opens the create class wizard as before.

Similarly, for broken classes (where the class is found, but cannot be
instantiated correctly) the following hyperlinks are offered:

- "Open Class", which shows the class in the editor

- "Show Error Log", which will open the IDE error log where you
  typically can find a full stack trace from the failed invocation.

In addition, this CL fixes
14546: Creating a custom view from the error output of the layout
editor creates it in gen
by ensuring that the gen/ folder is not one of the fragment roots
presented to the New Class wizard.

Change-Id: I06b8969800caaea719e4b52608a7ed130c91837d

13 years agoMerge "17466: Strip Whitespace from Project Name to Activity"
Tor Norbye [Wed, 8 Jun 2011 15:43:43 +0000 (08:43 -0700)]
Merge "17466: Strip Whitespace from Project Name to Activity"

13 years ago17466: Strip Whitespace from Project Name to Activity
Tor Norbye [Wed, 8 Jun 2011 05:36:11 +0000 (22:36 -0700)]
17466: Strip Whitespace from Project Name to Activity

Also moved the capitalize() method from DescriptorsUtils
to the AdtUtils method with the other general string
utilities.

Change-Id: Iffdbd906c5a4ecbd89c2f037d95f007e44733513

13 years agoMerge "Handle fragment tags in included contexts"
Tor Norbye [Wed, 8 Jun 2011 02:33:31 +0000 (19:33 -0700)]
Merge "Handle fragment tags in included contexts"

13 years agoHandle fragment tags in included contexts
Tor Norbye [Fri, 27 May 2011 01:55:26 +0000 (18:55 -0700)]
Handle fragment tags in included contexts

This changeset fixes the support for rendering user-chosen layouts in
<fragment> tags in a couple of scenarios:
- where the fragment is part of a layout that "surrounds" the current
  layout (e.g. "show included in")
- where the fragment is part of a layout that is included from the
  edited layout

In both cases, the fragment is read from a layout that is parsed with
a plain pull parser rather than the full XML node model used for
edited layouts, so to fix this the ContextPullParser now looks
specially for <fragment> tags and handles these specially.

In the second scenario, the parser is constructed by layoutlib, so we
have to use the project callback to anticipate requested parsers and
supply our own fragment-capable pull parsers instead.

Change-Id: I8aba253ac0c1a0d5dad7bc6efb9def5f20c75144

13 years agoCustom sort property sheet categories
Tor Norbye [Wed, 8 Jun 2011 02:19:11 +0000 (19:19 -0700)]
Custom sort property sheet categories

The property sheet is hardcoded to sort property categories
alphabetically.

Unfortunately, this means that for most widgets, the first properties
listed in the property sheet is "Deprecated" !

This changeset adds a custom sorter to the propertysheet, and sorts
the deprecated category to the bottom. It also sorts the "Misc"
category second to last, which means that you'll usually see the type
of the widget (e.g. "Button" or "EditText") at the top.

Change-Id: Ib2c8ec81cae82650a8a41e533e3803a1f6582fa7

13 years agoMerge "Add proper styleable support."
Xavier Ducrohet [Wed, 8 Jun 2011 00:08:30 +0000 (17:08 -0700)]
Merge "Add proper styleable support."

13 years agoAdd proper styleable support.
Xavier Ducrohet [Tue, 7 Jun 2011 23:25:12 +0000 (16:25 -0700)]
Add proper styleable support.

Change-Id: I2dc79e71521f93d798fd4a9b33aa59979bef379d

13 years agoMerge "17384: Clicking in the layout editor does not show its properties"
Tor Norbye [Tue, 7 Jun 2011 23:07:00 +0000 (16:07 -0700)]
Merge "17384: Clicking in the layout editor does not show its properties"

13 years ago17384: Clicking in the layout editor does not show its properties
Tor Norbye [Tue, 7 Jun 2011 22:58:34 +0000 (15:58 -0700)]
17384: Clicking in the layout editor does not show its properties

In Eclipse 3.6.2, the property sheet implementation no longer listens
to selection events; it only listens to post-selection events.

This is fixed in Eclipse 3.7, but we want to work on 3.6.2 too so work
around Eclipse issue #162079.

Change-Id: I9596364d3c5b7483a5c9053075b9b930293dfab9

13 years agoMerge "Guidelines for match_parent, and linear layout weight fixes"
Tor Norbye [Tue, 7 Jun 2011 01:26:11 +0000 (18:26 -0700)]
Merge "Guidelines for match_parent, and linear layout weight fixes"

13 years agoMerge "Show previews of resources in the resource & reference choosers"
Tor Norbye [Tue, 7 Jun 2011 01:26:06 +0000 (18:26 -0700)]
Merge "Show previews of resources in the resource & reference choosers"

13 years agoMerge "Buildfix"
Tor Norbye [Tue, 7 Jun 2011 01:01:47 +0000 (18:01 -0700)]
Merge "Buildfix"

13 years agoBuildfix
Tor Norbye [Tue, 7 Jun 2011 01:01:19 +0000 (18:01 -0700)]
Buildfix

Change-Id: I532e666a585e4fd13e9ff965ce9a7a448bc9f8b7

13 years agoGuidelines for match_parent, and linear layout weight fixes
Tor Norbye [Mon, 6 Jun 2011 19:39:25 +0000 (12:39 -0700)]
Guidelines for match_parent, and linear layout weight fixes

First, add guidelines to allow snapping to "match_parent" (or
fill_parent, depending on the API level).

Second, fix the linear layout resizing scheme to handle corner cases a
bit better (corner cases such as resizing to a smaller size than the
wrap_content bounds, or resizing inside a layout that is "full"). Also
split up the resizing code into a compute-method and an apply-method
such that we can display feedback for the current weight during the
resizing operation.

Change-Id: Idd2917230870d26f94473dabc1a2a6becc3ba738

13 years agoMerge "Move tools to r12 and ADT to 12.0.0"
Xavier Ducrohet [Tue, 7 Jun 2011 00:28:33 +0000 (17:28 -0700)]
Merge "Move tools to r12 and ADT to 12.0.0"

13 years agoMove tools to r12 and ADT to 12.0.0
Xavier Ducrohet [Mon, 6 Jun 2011 23:45:50 +0000 (16:45 -0700)]
Move tools to r12 and ADT to 12.0.0

Change-Id: Ifcf5190547e9e37bdda766ad3d57a312c2dbb481

13 years agoMerge "Add a new getParser method to IProjectCallback."
Xavier Ducrohet [Mon, 6 Jun 2011 23:21:49 +0000 (16:21 -0700)]
Merge "Add a new getParser method to IProjectCallback."

13 years agoAdd a new getParser method to IProjectCallback.
Xavier Ducrohet [Mon, 6 Jun 2011 22:29:32 +0000 (15:29 -0700)]
Add a new getParser method to IProjectCallback.

This is used to make the implementation easier with access to the
XML file path in the ResourceValue.

Change-Id: Iedbb194bdf4b3d17841be1d50c384b62615bae8f

13 years agoShow previews of resources in the resource & reference choosers
Tor Norbye [Sat, 4 Jun 2011 17:14:46 +0000 (10:14 -0700)]
Show previews of resources in the resource & reference choosers

This is a first cut of previews in the Resource Chooser and the
Reference Chooser. When the selected resource is a drawable or a
color, then a tray is shown on the right hand side of the dialog with
a preview of the given drawable or color. If the color is a state
list, then the fallback color is shown.

The previews only work for resource/reference choosers associated
with a layout editor (because it looks up the associated rendering
configuration from that editor). This should be made more generic
such that it can work for example when bringing up the resource
chooser from a manifest form editor.

Change-Id: I9f2896cb7ce1468076a3ca83f820be7e9affcda6

13 years agoMerge "do not package .scala files as resources"
Xavier Ducrohet [Mon, 6 Jun 2011 19:38:16 +0000 (12:38 -0700)]
Merge "do not package .scala files as resources"

13 years agodo not package .scala files as resources
Matthias Granberry [Mon, 6 Jun 2011 19:10:38 +0000 (14:10 -0500)]
do not package .scala files as resources

Change-Id: I8b0ac703fd60517f8c7857e7f7ce316e08ab51be

13 years agoMerge "Improve error message when ADT is older than layoutlib."
Xavier Ducrohet [Sat, 4 Jun 2011 01:26:41 +0000 (18:26 -0700)]
Merge "Improve error message when ADT is older than layoutlib."

13 years agoImprove error message when ADT is older than layoutlib.
Xavier Ducrohet [Sat, 4 Jun 2011 00:56:25 +0000 (17:56 -0700)]
Improve error message when ADT is older than layoutlib.

Change-Id: I1d52201c58f9fb92a87fd42585b653bf37730032

13 years agoMerge "Trim trailing whitespace in code completion test golden files"
Tor Norbye [Fri, 3 Jun 2011 20:15:16 +0000 (13:15 -0700)]
Merge "Trim trailing whitespace in code completion test golden files"

13 years agoMerge "Update unit test golden files to reflect recent changes"
Tor Norbye [Fri, 3 Jun 2011 20:14:57 +0000 (13:14 -0700)]
Merge "Update unit test golden files to reflect recent changes"

13 years agoMerge "Add support for the TV dpi."
Xavier Ducrohet [Fri, 3 Jun 2011 19:56:45 +0000 (12:56 -0700)]
Merge "Add support for the TV dpi."

13 years agoTrim trailing whitespace in code completion test golden files
Tor Norbye [Fri, 3 Jun 2011 19:32:20 +0000 (12:32 -0700)]
Trim trailing whitespace in code completion test golden files

There are no semantic changes.

Change-Id: I43eddc9372c6e5194ba645bbe2d2bedfc438c25b

13 years agoUpdate unit test golden files to reflect recent changes
Tor Norbye [Fri, 3 Jun 2011 19:25:41 +0000 (12:25 -0700)]
Update unit test golden files to reflect recent changes

Change-Id: I6c1eb0a0ab864f11cbc8cb9daddbf70189d03d11

13 years agoMerge "Refactor a method to extract an emulator port."
Brett Chabot [Fri, 3 Jun 2011 19:11:18 +0000 (12:11 -0700)]
Merge "Refactor a method to extract an emulator port."

13 years agoAdd support for the TV dpi.
Xavier Ducrohet [Fri, 3 Jun 2011 18:59:04 +0000 (11:59 -0700)]
Add support for the TV dpi.

Change-Id: I97fedc69644d83801b50d7882bb759db7089d8f0

13 years agoMerge "Fix bug in project-wide render target selection"
Tor Norbye [Thu, 2 Jun 2011 21:37:51 +0000 (14:37 -0700)]
Merge "Fix bug in project-wide render target selection"

13 years agoRefactor a method to extract an emulator port.
Brett Chabot [Thu, 2 Jun 2011 21:19:19 +0000 (14:19 -0700)]
Refactor a method to extract an emulator port.

Change-Id: I0dbab2c8f44a2114364075a91f31aa0d8d18d3ba

13 years agoFix bug in project-wide render target selection
Tor Norbye [Thu, 2 Jun 2011 20:55:09 +0000 (13:55 -0700)]
Fix bug in project-wide render target selection

I ran into a scenario where selecting a render target caused the new
target to be loaded, but then the selection jumped back to the
previous value. The reason for this is that there is a codepath from
the dropdown callback which ends up calling "syncRenderState" before
the old value has been saved, so syncRenderState will read the
previous value and sync it back to the dropdown. The fix is easy --
make sure we save the render state before notifying clients of the
change.

Change-Id: I28d8d8ec1e9c23311892ca05ab4348ae5aed90ae

13 years agoMerge "Extract client rules engine into top level class"
Tor Norbye [Thu, 2 Jun 2011 18:41:54 +0000 (11:41 -0700)]
Merge "Extract client rules engine into top level class"

13 years agoMerge "Fix invalid caching of project callback"
Tor Norbye [Thu, 2 Jun 2011 18:41:42 +0000 (11:41 -0700)]
Merge "Fix invalid caching of project callback"

13 years agoFix invalid caching of project callback
Tor Norbye [Thu, 2 Jun 2011 18:33:51 +0000 (11:33 -0700)]
Fix invalid caching of project callback

Change-Id: If7c0ee87e5263767e607cf226838e65667a5106c

13 years agoMerge "Fix: Filename isn't displayed on titlebar when the file not exist."
Tor Norbye [Thu, 2 Jun 2011 18:14:05 +0000 (11:14 -0700)]
Merge "Fix: Filename isn't displayed on titlebar when the file not exist."

13 years agoExtract client rules engine into top level class
Tor Norbye [Thu, 2 Jun 2011 15:17:42 +0000 (08:17 -0700)]
Extract client rules engine into top level class

The IDE-side implementation of the IClientRulesEngine interface was
nested within the RulesManager class, and has grown a lot over
time. This changeset moves it out as its own top level class. There
are no semantic changes, just a straightforward refactoring operation.

Change-Id: Ica072e8f7a06b822c6bde28e37b10ec86e05a402

13 years agoMerge "Simple code cleanup"
Tor Norbye [Thu, 2 Jun 2011 17:47:16 +0000 (10:47 -0700)]
Merge "Simple code cleanup"

13 years agoMerge "Properly configure KXml parsers."
Xavier Ducrohet [Thu, 2 Jun 2011 17:41:20 +0000 (10:41 -0700)]
Merge "Properly configure KXml parsers."

13 years agoSimple code cleanup
Tor Norbye [Thu, 2 Jun 2011 15:05:44 +0000 (08:05 -0700)]
Simple code cleanup

We had a number of constants for attribute values which had the prefix
VALUE_ but which were really attributes and should have the prefix
ATTR_.  We already had the equivalent ATTR_ constants, so get rid of
the VALUE_ constants and clean up the usage slightly.

Change-Id: Icc0f0ad8910695b4ac4904c620f73d6cf4bcacba

13 years agoMerge "Typo."
Tor Norbye [Thu, 2 Jun 2011 14:54:49 +0000 (07:54 -0700)]
Merge "Typo."

13 years agoTypo.
Kenji Tan [Thu, 2 Jun 2011 05:57:08 +0000 (22:57 -0700)]
Typo.

Fixed a typo. "Diplay" should read "Display".

Change-Id: I8b20e1c76e686e9ab5fa8ba9f8cee9a2ad1cd2a7

13 years agoProperly configure KXml parsers.
Xavier Ducrohet [Thu, 2 Jun 2011 01:30:53 +0000 (18:30 -0700)]
Properly configure KXml parsers.

Change-Id: If307659aabe37c5204f7e40c10fc93576de0e145

13 years agoMerge "Move rendering code into RenderService class"
Tor Norbye [Thu, 2 Jun 2011 01:22:24 +0000 (18:22 -0700)]
Merge "Move rendering code into RenderService class"

13 years agoMerge "Resize & Guideline Support"
Tor Norbye [Thu, 2 Jun 2011 01:21:39 +0000 (18:21 -0700)]
Merge "Resize & Guideline Support"

13 years agoMerge "Add Resize Support to the Layout Editor"
Tor Norbye [Thu, 2 Jun 2011 01:19:58 +0000 (18:19 -0700)]
Merge "Add Resize Support to the Layout Editor"

13 years agoMove rendering code into RenderService class
Tor Norbye [Wed, 1 Jun 2011 18:38:27 +0000 (11:38 -0700)]
Move rendering code into RenderService class

This CL moves the various rendering-related code in
GraphicalEditorPart into a separate RenderService class, which can be
configured for different purposes:

- Rendering a layout shown in the canvas
- Rendering palette previews
- Rendering a preview of a node during a drag from a palette
- Rendering a theme drawable
- Rendering layout-only to measure preferred sizes

Once configured, the rendering service can be used repeatedly and off
the UI thread to for example render all the palette previews without
blocking editor startup. This will be addressed in a follow-up CL.

Change-Id: I851148d80c3a4dc9e4b5b66c9838ae49809ea03c

13 years agoResize & Guideline Support
Tor Norbye [Sun, 10 Apr 2011 15:18:45 +0000 (08:18 -0700)]
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

13 years agoAdd Resize Support to the Layout Editor
Tor Norbye [Thu, 7 Apr 2011 03:36:57 +0000 (20:36 -0700)]
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

13 years agoMerge "SdkMan2: fix package deletion."
Raphael Moll [Tue, 31 May 2011 19:37:49 +0000 (12:37 -0700)]
Merge "SdkMan2: fix package deletion."