OSDN Git Service
Tor Norbye [Tue, 5 Apr 2011 15:59:12 +0000 (08:59 -0700)]
Update changes.txt for ADT 10 and 10.0.1
Change-Id: I8810fd34dc10c4e73787857b078aeac83f0857b1
Xavier Ducrohet [Mon, 4 Apr 2011 23:57:44 +0000 (16:57 -0700)]
Merge "Zoom with scrollwheel in Traceview."
Xavier Ducrohet [Mon, 4 Apr 2011 23:52:40 +0000 (16:52 -0700)]
Merge "Added about files for Traceview plugin."
Xavier Ducrohet [Mon, 4 Apr 2011 23:47:55 +0000 (16:47 -0700)]
Merge "Changed bundle versions in some manifests."
Xavier Ducrohet [Mon, 4 Apr 2011 23:42:25 +0000 (16:42 -0700)]
Merge "Fix in MethodProfilingHandler."
Xavier Ducrohet [Mon, 4 Apr 2011 22:57:52 +0000 (15:57 -0700)]
Merge "LayoutLib API: update adapter binding callbacks."
Xavier Ducrohet [Mon, 4 Apr 2011 20:57:05 +0000 (13:57 -0700)]
LayoutLib API: update adapter binding callbacks.
Change-Id: I85be09fd7541da366c858ea04d7c2c4b53948475
Tor Norbye [Mon, 4 Apr 2011 22:34:16 +0000 (15:34 -0700)]
Merge "Pick layout themes from manifest registrations and target SDK"
Tor Norbye [Thu, 17 Mar 2011 00:37:48 +0000 (17:37 -0700)]
Pick layout themes from manifest registrations and target SDK
This changeset changes the way the layout editor picks themes when a
layout is opened. It used to just pick the first available theme in
the theme chooser.
Now it performs the following checks, in order:
* Does this layout have a persisted theme setting from a previous run
of the tool? If yes, use it.
* Can the activity for this layout be determined? If so, look at the
manifest registration for the corresponding activity, and if it
specifies a theme, use it.
* If not, does the manifest specify a default theme for the project?
If so, use it.
* If not, is the target SDK version (or the minimum SDK version, if
the target is not specified) at least API level 11 or higher? If so,
the default theme is "Theme.Holo"
* If not, the default theme is "Theme".
* If the file to be opened is included from some other layout, use
the no-decorations versions of the default layouts, e.g.
Theme.NoTitleBar or Theme.Holo.NoActionBar.
* At the end of this resolution, the computed theme is stored as the
persisted theme setting for this layout, so the above algorithm will
only be computed once. We might want to tweak this such that it
distinguishes between a default computation of a theme and a manual
user choice of a theme.
* If the file is opened as "Show Included In" (e.g. rendered within an
outer file) then the theme chosen is the one for the outer file.
During startup, this information will be asked for each and every
layout being reopened, so there is now a "ManifestInfo" class attached
to the project which keeps manifest information around. It checks the
timestamp of the AndroidManifest.xml file and refreshes its
information lazily if necessary.
All themes mentioned in the manifest are listed in a special section
at the top of the theme chooser (below the entry for the default
computed described above).
The code to look up the associated Activity of a layout is using a
simple heuristic: it looks for usages of the corresponding R.layout
field, and prefers references from methods called onCreate or in
classes whose superclass name ends with Activity. I tried a different
approach where I searched for usages of Activity.setContentView(int)
but this failed to identify a number of cases where the activity was
doing some simple logic and didn't pass the layout id directly as a
parameter in setContentView, so I went back to the basic approach.
Change-Id: Ibd3c0f089fefe38e6e6c607d65524990699c86d3
Tor Norbye [Mon, 4 Apr 2011 22:27:16 +0000 (15:27 -0700)]
Merge "Make code completion skip the layout_ prefix if necessary"
Tor Norbye [Mon, 4 Apr 2011 22:27:05 +0000 (15:27 -0700)]
Merge "Add frequency count to Extract Style refactoring wizard"
Tor Norbye [Mon, 4 Apr 2011 22:17:30 +0000 (15:17 -0700)]
Add frequency count to Extract Style refactoring wizard
The frequency count lists the number of attributes with a given value
out of the total number of elements, to help make it obvious if an
attribute is *not* specified for one or more elements. Without this,
only the elements with a value would be shown or counted.
Change-Id: I7866ea069090a766ab1f1cb4d7004d2763c59c5e
Xavier Ducrohet [Mon, 4 Apr 2011 21:01:08 +0000 (14:01 -0700)]
Merge "Dynamically generated resources id were not used in id resolution."
Xavier Ducrohet [Mon, 4 Apr 2011 21:01:05 +0000 (14:01 -0700)]
Merge "Add toString to ResourceReference"
Xavier Ducrohet [Mon, 4 Apr 2011 21:01:01 +0000 (14:01 -0700)]
Merge "Fix value of dynamic resource IDs used when rendering."
Xavier Ducrohet [Mon, 4 Apr 2011 20:39:54 +0000 (13:39 -0700)]
Dynamically generated resources id were not used in id resolution.
Dynamic IDs are generated when requesting an int value from a
(type,name) pair where type==ResourceType.ID and the name doesn't
reference any existing ID (This is possible when IDs are declared inline
and the layout file has not been saved, for instance, so the R class
has not been regenerated yet).
There is a reverse method querying for a (type,name) pair based on
an integer. This methods was not looking for generated id and would
return null instead of the name associated with the generated ID.
Change-Id: I0bc4bc76a5157d56d06c5f4538c4fcc38f1bded7
Xavier Ducrohet [Mon, 4 Apr 2011 20:24:54 +0000 (13:24 -0700)]
Add toString to ResourceReference
Change-Id: I9ea9625a839a4dc2c9d03baa5b0d56ddc7f198ee
Xavier Ducrohet [Mon, 4 Apr 2011 20:24:09 +0000 (13:24 -0700)]
Fix value of dynamic resource IDs used when rendering.
Change-Id: Ic6c0fad53d06e48dcd8ab59c5aa0c2a530e36767
Tor Norbye [Mon, 4 Apr 2011 18:24:51 +0000 (11:24 -0700)]
Make code completion skip the layout_ prefix if necessary
The code completion prefix matcher already lets you skip the
namespace, so you can type "width" and it will expand to
"android:width".
This changeset adds "layout_" to this scheme, so you can type
"margin", and this will match "layout_margin" as well.
Change-Id: I8bf71e91ac8ac71bd2cb0308c6f1d39a9dfaa66a
Tor Norbye [Mon, 4 Apr 2011 19:11:29 +0000 (12:11 -0700)]
Merge "Improve painting of combined selection and hover"
Brett Chabot [Mon, 4 Apr 2011 17:10:33 +0000 (10:10 -0700)]
Merge "Bundle ninepatch.jar inside ninepatch-tests.jar"
Tor Norbye [Sat, 2 Apr 2011 04:00:24 +0000 (21:00 -0700)]
Improve painting of combined selection and hover
When the mouse is over a rectangle, we highlight this "hover"
rectangle by painting a semitranslucent white rectangle on top of it.
When a view is selected, we highlight it by painting a semitranslucent
blue rectangle over it.
This means that if you move the mouse over the selection, you get both
of these effects added together, which dilutes the underlying selected
widget too much.
This changeset tries to improve this situation by defining a different
visual style to be used for the combination of hover and selection,
where the opacity is much lower for the hover in this case.
This changeset also reduces the existing hover by about 30% opacity.
Change-Id: I63ffe8a9d756dcae29b2009a1a1cd6b9ffb6fbe7
Tor Norbye [Fri, 1 Apr 2011 22:29:58 +0000 (15:29 -0700)]
Merge "Update test to track layoutlib change"
Tor Norbye [Fri, 1 Apr 2011 22:26:15 +0000 (15:26 -0700)]
Update test to track layoutlib change
Change-Id: Ie4ccd0d05a85ebbb03fefb9ba1e31dfbde1a89be
Xavier Ducrohet [Fri, 1 Apr 2011 21:34:20 +0000 (14:34 -0700)]
Merge "Add a way to get the adapter binding through the project callback."
Xavier Ducrohet [Fri, 1 Apr 2011 21:26:50 +0000 (14:26 -0700)]
Add a way to get the adapter binding through the project callback.
Change-Id: I0de48e3519f38a63c3462f5eb0c7f6c2a29d0e6f
Tor Norbye [Fri, 1 Apr 2011 21:18:43 +0000 (14:18 -0700)]
Merge "Improve view cookie handling"
Tor Norbye [Wed, 30 Mar 2011 15:42:46 +0000 (08:42 -0700)]
Improve view cookie handling
The layout editor is passed a ViewInfo hierarchy by the layout
library. For older versions of the layout library, it can be handed
hierarchies where the view cookies (which point back to XML model
objects corresponding to the rendered views) that are missing or
ambiguous. For that reason, it has various algorithms to try to piece
things back together, and for example handle <merge> scenarios as best
it can.
This isn't necessary with layout lib version 5 and higher, since as of
version 5 these scenarios are handled on the layout lib side and the
layout editor is passed back special cookies like the MergeCookie to
properly handle the various scenarios.
This fix makes the layout editor look up the layoutlib version, and if
dealing with version 5 or higher, it takes a simpler path to build up
the hierarchy.
This is also necessary to deal with the latest version of layoutlib
which passes a new type of view cookie which the older algorithm
couldn't handle.
Change-Id: I98c3ba5d17ad9d639eb118e4709c0b6bbf815b0a
Tor Norbye [Thu, 31 Mar 2011 23:01:01 +0000 (16:01 -0700)]
Merge "Extract Style Refactoring"
Bill Napier [Thu, 31 Mar 2011 19:42:38 +0000 (12:42 -0700)]
Merge "Add initial and final MOVE events on drag."
Tor Norbye [Mon, 28 Mar 2011 16:16:41 +0000 (09:16 -0700)]
Extract Style Refactoring
Adds a new refactoring, "Extract Style", which will show the user the
attributes for the current selected elements (or if invoked from an
editor context, the attributes overlapping the current caret or editor
selection). The user can select which attributes to extract, and these
are then added as a new style in the styles.xml file in the project
(which is created if necessary). The user can optionally replace the
attributes that were extracted, and the user can also optionally set
the style attribute on the elements to the new style. (Both are on by
default.) This is integrated with the refactoring quick assistant as
well.
Change-Id: I0504e86a824b00730482607150a879ff28233618
Bill Napier [Tue, 8 Mar 2011 01:03:00 +0000 (17:03 -0800)]
Add initial and final MOVE events on drag.
Change-Id: I88dfc808f34a862941640ad8c9ddd49051e85f72
Tor Norbye [Thu, 31 Mar 2011 00:27:22 +0000 (17:27 -0700)]
Merge "Make sure files opened from XML wizard go to the WYSIWYG editor"
Tor Norbye [Wed, 30 Mar 2011 22:31:29 +0000 (15:31 -0700)]
Merge "Auto-zoom views the first time they are opened"
Xavier Ducrohet [Wed, 30 Mar 2011 20:55:33 +0000 (13:55 -0700)]
Merge "Add repeat count config to layoutlib_api's AdapterBinding."
Tor Norbye [Wed, 30 Mar 2011 16:20:02 +0000 (09:20 -0700)]
Auto-zoom views the first time they are opened
Now that we default to the tablet screen size, creating a new layout
usually opens up a view which only shows the top left part of the
design view, and horizontal and vertical scrollbars.
This changeset adds auto-zoom such that the first time a view is
opened, the view also auto-zooms. Note that the type of zooming
performed is zoom-out-only; it never zooms in, so a small phone layout
will continue to be shown at 100%. We already perform auto-zoom in
several other scenarios (such as changing orientation).
Change-Id: I1e9a9e8357c952f84b541ea799c529d5dc4b3239
Tor Norbye [Wed, 30 Mar 2011 15:44:15 +0000 (08:44 -0700)]
Make sure files opened from XML wizard go to the WYSIWYG editor
Change-Id: I51a0d96564b5fa896eb4daef50f193df7cadfa20
Xavier Ducrohet [Wed, 30 Mar 2011 00:26:07 +0000 (17:26 -0700)]
Add repeat count config to layoutlib_api's AdapterBinding.
Change-Id: Idbb54de6dee6d6b466476a0e3acdd87dd394ee42
Xavier Ducrohet [Tue, 29 Mar 2011 20:46:37 +0000 (13:46 -0700)]
Merge "Add support for data binding in the layout editor."
Xavier Ducrohet [Tue, 29 Mar 2011 18:01:49 +0000 (11:01 -0700)]
Add support for data binding in the layout editor.
The Layoutlib_api is changed to allow passing information regarding
adapter content, and querying eclipse to fill the items.
Change-Id: Ie5a047ab9cd0ed7677c13309d95663eae462c3e7
Tor Norbye [Mon, 28 Mar 2011 22:57:32 +0000 (15:57 -0700)]
Merge "Test infrastructure fixes"
Tor Norbye [Wed, 23 Mar 2011 13:58:26 +0000 (06:58 -0700)]
Test infrastructure fixes
Add methods which allow a test case to specify that it needs a unique
project for the testcase (or even for each individual test
method). This allows tests which modify the project (such as the
quickfix-resource-creation tests) to not cause side effects that
affect other tests (e.g. resources created by the quickfix could show
up in code completion results by the code completion tests, which
meant the goldenfiles would have to either include them or exclude
them, which meant the tests must always be run together or never run
together.
The changeset also adds an environment variable pointing to the git
working copy allowing tests with no golden file to create the golden
files directly. This makes it easy to add new test cases; just write
the test scenarios, run them, which will fail all the tests but also
write out the expected golden files. Verify them and check them in and
running the tests again should pass if the output is stable.
Change-Id: I2e2789c00c84a31a9fbc603851879d8d83342ad3
Tor Norbye [Mon, 28 Mar 2011 21:01:30 +0000 (14:01 -0700)]
Merge "15736: Eclipse crashes in layout editor when browsing element's properties"
Tor Norbye [Mon, 28 Mar 2011 21:01:18 +0000 (14:01 -0700)]
Merge "Code completion in style definitions & other improvements"
Xavier Ducrohet [Mon, 28 Mar 2011 20:29:45 +0000 (13:29 -0700)]
Merge "Better default selection when choosing a device config."
Tor Norbye [Mon, 28 Mar 2011 18:24:48 +0000 (11:24 -0700)]
15736: Eclipse crashes in layout editor when browsing element's properties
This changeset attempts to fix issue 15736. The root bug is an SWT bug
which can cause a JVM crash in some scenarios. However, it seems to be
triggered by code which performs a gradient paint in the property
sheet (which is in fact done to work around another SWT bug...).
Using a gradient is not necessary - a plain background paint will do -
so this changeset simplifies the code to only fill the background. It
also leaves the selection flag on the event alone such that other
parts of the list (such as category items) are not affected.
Change-Id: Ica32fe1e6f49f1e4154c3ffad9cae9799fcc4723
Brett Chabot [Sat, 26 Mar 2011 02:41:38 +0000 (19:41 -0700)]
Bundle ninepatch.jar inside ninepatch-tests.jar
Change-Id: Ie659cfdc1bce12f51aca4a636ea117142f8c4be1
Tor Norbye [Wed, 23 Mar 2011 23:42:13 +0000 (16:42 -0700)]
Code completion in style definitions & other improvements
This changeset adds code completion support to resource files where
<style> elements are defined. In particular, you get two types of
completion:
- Completion on names: <style><item name="|" >
Here you get offered ALL matching attribute names from any view
descriptors.
- Completion on values: <style><item name="android:gravity">|</item>
Here you get offered all values that correspond to the attribute
named as the value of the name attribute of the surrounding item
element.
Unrelated to styles, code completion will now also move the caret
outside the attribute value quotes when you enter one of the value
alternatives (unless the value is a flag type or a resource token).
Also, run-on attributes are also handled more gracefully: if you
complete properties with the caret immediately following another
attribute, a separating space is added into the match as a prefix such
that the new attribute is separated and the XML valid.
There are a lot of diffs in this changeset. In order to allow the
ResourcesContentAssist to extend code completion to add its style-
specific logic, the content assist code had to be split up a bit.
Doing completion in text nodes, or potential text nodes (e.g. if you
have <item>|</item> you should get text completion at that caret
offset even though there is no text node child of the item element
until you insert actual text there) also required some changes.
There are many new unit tests. I also changed the golden file format
slightly to show the caret in the before-view such that it's more
obvious how the caret was affected by inserting the new item.
Change-Id: Ia985db7e848fea33e93ac8a70b2c3b4dbfd9056a
Tor Norbye [Fri, 25 Mar 2011 23:39:13 +0000 (16:39 -0700)]
Merge "Handle AAPT ranges in value resource files"
Tor Norbye [Fri, 25 Mar 2011 22:02:22 +0000 (15:02 -0700)]
Handle AAPT ranges in value resource files
The earlier fix to add editor column ranges for AAPT errors handled
the types of errors that occur in layout .xml files. In value
definition files there are several additional error messages that can
be parsed to infer the actual error range on the line. This changeset
adds handling for these additional cases, plus various unit tests.
It also fixes a couple of corner cases in layout files - in
particular, the case where a resource value is missing, and the case
where there are other -valid- uses of the same value earlier on the
same line where the first reference would be highlighted rather than
the one following the property in error.
Change-Id: I02906ada43a884d7518348924715892de9d33311
Brett Chabot [Fri, 25 Mar 2011 02:06:37 +0000 (19:06 -0700)]
Merge "Add more sdk lib tests to sdk build."
Brett Chabot [Thu, 24 Mar 2011 05:24:15 +0000 (22:24 -0700)]
Add more sdk lib tests to sdk build.
Change-Id: I09946be68f244922de0ad89d970e53165957fa2b
Xavier Ducrohet [Mon, 21 Mar 2011 22:41:57 +0000 (15:41 -0700)]
Better default selection when choosing a device config.
Change-Id: Iacaabec4ad9e9dd55397dc2cc3e6bfadc0c11ff2
Raphael Moll [Thu, 24 Mar 2011 17:00:12 +0000 (10:00 -0700)]
Merge "Revert "build/tools.atree: Move x86-specific changes to tools.x86.atree""
Raphael Moll [Wed, 23 Mar 2011 22:04:00 +0000 (15:04 -0700)]
Revert "build/tools.atree: Move x86-specific changes to tools.x86.atree"
This reverts commit
253acabecba0d9f649f04499f6dda980fbe7bf49.
Raphael Moll [Thu, 24 Mar 2011 16:55:59 +0000 (09:55 -0700)]
Merge "Revert "Fix WIN SDK build: don't break if emulator-x86 is missing.""
Tor Norbye [Thu, 24 Mar 2011 04:10:10 +0000 (21:10 -0700)]
Merge "Added a New Folder action in File Explorer."
Brett Chabot [Thu, 24 Mar 2011 02:34:03 +0000 (19:34 -0700)]
Merge "Add ddmlib-tests to sdk build in a tests/libtests dir."
Brett Chabot [Wed, 23 Mar 2011 03:50:22 +0000 (20:50 -0700)]
Add ddmlib-tests to sdk build in a tests/libtests dir.
Change-Id: Idba9f5b5724926209bbb96bfd75e04dbffa3760c
Raphael Moll [Wed, 23 Mar 2011 22:03:53 +0000 (15:03 -0700)]
Revert "Fix WIN SDK build: don't break if emulator-x86 is missing."
This reverts commit
ecd2f055e09ebe5a16244b91af1c6f80cae671a0.
Raphael Moll [Wed, 23 Mar 2011 20:05:59 +0000 (13:05 -0700)]
Merge "Fix WIN SDK build: don't break if emulator-x86 is missing."
Raphael Moll [Wed, 23 Mar 2011 20:01:10 +0000 (13:01 -0700)]
Fix WIN SDK build: don't break if emulator-x86 is missing.
The core issue is why emulator-x86 is missing from the build.
Whilst we investigate why, this will unbreak the build. We should
revert this once the emu-x86 is built correctly again.
Change-Id: I4852490f1fea91ea18a798be28411f5a57a31a89
David 'Digit' Turner [Wed, 23 Mar 2011 17:35:35 +0000 (10:35 -0700)]
Merge "build/tools.atree: Move x86-specific changes to tools.x86.atree"
David 'Digit' Turner [Wed, 23 Mar 2011 10:37:57 +0000 (11:37 +0100)]
build/tools.atree: Move x86-specific changes to tools.x86.atree
Unfortunately, the latest x86-specific changes to tools.atree break
internal Android builds that depend on this file.
This change moves the changes to a different file that is only
parsed for x86-specific SDK builds (sdk_x86-eng).
It depends on https://review.source.android.com/#change,21957
to allow the AOSP build to pick up tools.x86.atree properly.
Change-Id: I163d7fb43aa06609d9b0e4bfbaf56311958ea25e
Raphael Moll [Tue, 22 Mar 2011 18:48:26 +0000 (11:48 -0700)]
Merge "Fix AvdManager to correctly find emulator in AOSP."
Raphael Moll [Tue, 22 Mar 2011 18:10:53 +0000 (11:10 -0700)]
Fix AvdManager to correctly find emulator in AOSP.
This is a temporary workaround on the lack of a main
"emulator" binary in AOSP, which will be fixed later.
Change-Id: I61f03ed8a54a410469f95a1100ef38eef7ab4bf6
David Turner [Tue, 22 Mar 2011 17:31:00 +0000 (10:31 -0700)]
Merge "Revert "DISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)""
Bruce Beare [Tue, 22 Mar 2011 16:04:03 +0000 (09:04 -0700)]
Revert "DISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)"
This reverts commit
147e8b73aefa28ef599628c718060450539b6102.
The original commit was merged out of sequence - thus the need for the
original revert. All dependent commits are now complete so we can put back
in place the original change.
Pierre Zurek [Fri, 11 Feb 2011 23:04:48 +0000 (00:04 +0100)]
Added a New Folder action in File Explorer.
This action allows the user to create a new folder if the current
selection in the tree is a folder. It executes the "mkdir" command
on the device. If an error occurs during execution, a popup is
displayed.
Change-Id: Id94485502849679ee9c753882b3e46f30e0edd1e
Tor Norbye [Mon, 21 Mar 2011 22:38:35 +0000 (15:38 -0700)]
Merge "NPE fix"
Tor Norbye [Mon, 21 Mar 2011 22:35:35 +0000 (15:35 -0700)]
NPE fix
Change-Id: I35d0407ef20557c19b6eca5324075de9fbbf8583
Raphael Moll [Mon, 21 Mar 2011 20:28:13 +0000 (13:28 -0700)]
Merge "SDK Manager dialog to manage user add-on sites."
Raphael Moll [Mon, 21 Mar 2011 20:26:38 +0000 (13:26 -0700)]
Merge "Revamp of the SDK Manager UI."
Tor Norbye [Mon, 21 Mar 2011 20:21:05 +0000 (13:21 -0700)]
Merge "Applying the previous rotation state when refreshing screen image."
Tor Norbye [Mon, 21 Mar 2011 20:03:49 +0000 (13:03 -0700)]
Merge "Refactoring Quick Assistant"
Tor Norbye [Mon, 21 Mar 2011 19:59:51 +0000 (12:59 -0700)]
Merge "Add go to declaration support for styles and embedded text"
Tor Norbye [Fri, 18 Mar 2011 18:31:26 +0000 (11:31 -0700)]
Add go to declaration support for styles and embedded text
This changeset adds support to the Go To Declaration code for styles.
Style strings are a bit different from resource URLs - they can have
an @android: prefix, but they don't specify a resource type. For
example, go to declaration can now jump to the value in the parent
attribute:
<style name="BrowserTheme" parent="@android:Theme.Black">
This will show the Theme.Black style definition in the SDK's
styles.xml document.
In addition, the hyperlink resolver can now also link to fragments of
an attribute value. In particular, in the above, if you point anywhere
to the left of the ".", only the @android:Theme range will be
selected. This lets you go to parents, since styles inherit from other
styles by adding to them with dots.
Third, the hyperlink resolver can now link to resource urls that is in
the content part of XML documents (e.g. a text node, not an element
name or attribute value). As an example, you can now jump to the color
defined inside this style element:
<style name="CustomTheme" parent="android:Theme.Light">
<item name="android:bg">@color/custom_theme_color</item>
</style>
Finally, this changeset adds unit/plugin tests for the hyperlink
resolver, which asserts the expected list of matches, and the expected
editor context when the default link is opened.
Change-Id: I73757ec78405f7c711e13387d0bb046f698799f1
Tor Norbye [Mon, 21 Mar 2011 19:43:18 +0000 (12:43 -0700)]
Merge "More code completion fixes"
Tor Norbye [Sat, 19 Mar 2011 22:35:02 +0000 (15:35 -0700)]
More code completion fixes
This changeset fixes additional corner cases for XML code completion.
It handles inserting "new" attributes in more places, meaning for
example that if you code complete here <Button ^/> you will still get
"new" completion where the inserted attribute contains ="^".
Similarly the completer also handles inserting full element tags (with
opening and closing tags) in more scenarios, and still avoids doing
this in the case where you are on an opening line of an element which
already contains attributes on subsequent lines.
The new unit tests reveal additional minor corner cases.
Change-Id: I3f1b903e1c1768e4bdd42a5486ce729e348c4da5
Tor Norbye [Sun, 20 Mar 2011 22:45:20 +0000 (15:45 -0700)]
Refactoring Quick Assistant
Add another quick assistant to the editor which offers the various
refactoring operations for the current editing context. If the caret
is in a value declaration, then the "Extract String" refactoring is
offered. Otherwise, if the caret is on an element tag name (or opening
or closing tag), then the element-related visual refactorings are
offered (wrap in, change widget, change layout, extract as include)
provided of course the current editor is a layout editor.
Change-Id: Iee4033d2766d2d4a1157789b81602d37a5175c88
Tor Norbye [Mon, 21 Mar 2011 19:27:25 +0000 (12:27 -0700)]
Merge "On ImageView or ImageButton drop, ask user for drawable"
Tor Norbye [Mon, 21 Mar 2011 19:27:12 +0000 (12:27 -0700)]
Merge "Add large, medium and small TextViews to the palette"
Tor Norbye [Mon, 21 Mar 2011 19:26:42 +0000 (12:26 -0700)]
Merge "Add newline inside new root elements, and some move code around"
Tor Norbye [Fri, 18 Mar 2011 02:59:38 +0000 (19:59 -0700)]
Add newline inside new root elements, and some move code around
Tweak the "New XML File" creation code to insert a new line inside the
created root element, indent, and place the cursor there. This means
that you end up with:
<LinearLayout>
|
</LinearLayout>
instead of (where | denotes the initial caret position):
|<LinearLayout>
</LinearLayout>
This means you can instantly press Ctrl-Space to complete on the
elements, etc., and is similar to how Eclipse creates new method
bodies from templates, adding newlines such that you can instantly
write code there instead of having to "open them up".
All the diffs for this are in NewXmlFileWizard.java; the other
modifications in this changeset are simple move refactoring
operations as described next:
The second change in this changeset is moving some code around such
that common utility methods live in more natural places rather than
where they were first needed.
In particular:
Hyperlinks.openUrl => AdtPlugin
Hyperlinks.openJavaClass => AdtPlugin
Hyperlinks.openFile => AdtPlugin
AndroidContentAssist.getAndroidXmlEditor => AndroidXmlEditor
ResourceChooser.canCreateResource => ResourceHelper
ResourceChooser.createResource => ResourceHelper
Hyperlinks.parseResource => ResourceHelper
ResourceNameValidator.isValueBasedResourceType => ResourceHelper
ResourceNameValidator.isFileBasedResourceType => ResourceHelper
Change-Id: If7690df9ce59c709c1d909ffd9f74c2684f3dd46
Keiji Ariyama [Mon, 21 Mar 2011 08:52:18 +0000 (17:52 +0900)]
Applying the previous rotation state when refreshing screen image.
Change-Id: I04e81b591701e096bb553ac31af3226fa6d6b3f6
Tor Norbye [Mon, 21 Mar 2011 18:23:12 +0000 (11:23 -0700)]
Merge "Add custom views and third party views to the palette"
Tor Norbye [Mon, 21 Mar 2011 03:32:14 +0000 (20:32 -0700)]
Add large, medium and small TextViews to the palette
Add variations of TextView using the various textAppearance
attributes to get the standard styles for large, medium
and small text views:
?android:attr/textAppearanceLarge
?android:attr/textAppearanceMedium
?android:attr/textAppearanceSmall
Also removes EditText from the Form Widgets category to
discourage using the untyped field.
Change-Id: I8cf58492d3acbee7a6d2a7f183830fb8a854e3c8
Tor Norbye [Thu, 17 Mar 2011 16:00:14 +0000 (09:00 -0700)]
Add custom views and third party views to the palette
This changeset adds a new category to the palette, "Custom & Third
Party Views", which is populated with android.view.View subclasses
found in the current project (or any of its libraries), and in any
jars included by the project. They can be dragged directly to the
canvas, and control clicking on the palette entries will jump to the
source.
There are a bunch of adjustments in various places to make working
with custom views better - from ensuring that we don't use fully
qualified class names in default ids, to showing the Java class icon
for custom views in outline and elsewhere, to making zero-sized view
highlight and expand when selected like we do for laoyuts - since with
custom views it's quite easy to end up with an "invisible" view that
you can't see after dropping it.
There are also some fixes to the code which looks up third party and
custom views (which was already used by the Wrap In refactoring) - to
handle inner classes, to filter out non public or abstract classes,
and most importantly to only include views reachable from the current
project (since the view search necessarily is workspace wide.)
Change-Id: If1d8c7e5c7dd907a68d8d0962e85c5144e911503
Tor Norbye [Sat, 19 Mar 2011 23:22:58 +0000 (16:22 -0700)]
On ImageView or ImageButton drop, ask user for drawable
Similar to the <include> tag handling, when you drop an image a
resource chooser inputting @drawable resources pops up and lets you
pick the drawable to be shown in the image. If you cancel, then the
default image will be set instead.
Change-Id: Id09801a877acbeb437f518cefe60062ac92e7e7c
Xavier Ducrohet [Fri, 18 Mar 2011 20:27:28 +0000 (13:27 -0700)]
Merge "Fix unit tests from the previous refactor."
Tor Norbye [Fri, 18 Mar 2011 20:00:49 +0000 (13:00 -0700)]
Merge "Make edit texts grow in horizontal LinearLayouts using weights"
Tor Norbye [Fri, 18 Mar 2011 19:59:52 +0000 (12:59 -0700)]
Merge "Fix AAPT error range"
Xavier Ducrohet [Fri, 18 Mar 2011 19:13:51 +0000 (12:13 -0700)]
Fix unit tests from the previous refactor.
Change-Id: I464fe3f94e701e619b474f82aaf84ee04d158e71
Tor Norbye [Fri, 18 Mar 2011 03:53:52 +0000 (20:53 -0700)]
Make edit texts grow in horizontal LinearLayouts using weights
If you drop a text field in a vertical linear layout, then the *width*
of the text field is automatically set to fill. This uses metadata to
check what the fill preference is of each dropped view.
This changeset extends this scheme to also grow text fields in a
horizontal linear layout. However, instead of using fill_parent on the
layout_width, this uses a layout_weight instead. This means that the
text field will fill, but it will not push subsequent children out of
the way the way a fill_parent would.
This changeset also changes the default orientation of a LinearLayout
that is created in new XML files. (I looked around and noticed most
layouts that have a LinearLayout at the root will use a vertical
LinearLayout.)
Change-Id: I52eec4841e4bac076da655c603235547cfd46b73
Xavier Ducrohet [Fri, 18 Mar 2011 18:29:08 +0000 (11:29 -0700)]
Merge "Move classes to ide-common"
Tor Norbye [Fri, 18 Mar 2011 18:27:52 +0000 (11:27 -0700)]
Fix AAPT error range
Turns out the AAPT errors always list a line number that corresponds
to the line where the element starts. If the error occurs in an
attribute that is on a subsequent line, the code to identify the
editor offset failed.
This changeset addresses that, by using a document forward search to
locate the attribute. The quickfix code was also checking for an exact
line number match, so that code is tweaked as well.
Change-Id: Ib648d2e2e7ad3ba082fd3c6a48e7f077b3aebc10
Xavier Ducrohet [Fri, 18 Mar 2011 17:05:14 +0000 (10:05 -0700)]
Merge "Remove references to SWT from classes that are moving to ide-common."
Raphael Moll [Fri, 18 Mar 2011 17:03:14 +0000 (10:03 -0700)]
Merge "Remove unused contentTypeBinding."
Raphael Moll [Fri, 18 Mar 2011 05:34:46 +0000 (22:34 -0700)]
Remove unused contentTypeBinding.
This was added as a test when investigating the issue 15003.
It's actually harmful and prevents from following links to
like @android:string/ok from XML resource files.
Change-Id: Ib0ae523a139cff960b222c138136c27902f26e7a
Xavier Ducrohet [Fri, 18 Mar 2011 01:52:22 +0000 (18:52 -0700)]
Move classes to ide-common
ResourceFolder/File and children classes (single/multi file)
ResourceItem and children classes
ResourceRepository (base and framework, project stays in ADT for now)
All the ResourceQualifiers and FolderConfiguration
Change-Id: I5adc9bdc4886a8fa0ab44860763d594cf7af4bd5