Commit Graph

386 Commits

Author SHA1 Message Date
Raphael
4ed80aea34 Fix potential NPE in manifest editor when switching SDKs
The UiElementNode depends on the target to compute the
description and it's entirely possible for the target to
be null while the SDK is being unloaded/reloaded.

SDK BUG 2196260

Change-Id: I4151529ea3b6a65eade47d03e55fc93cad8596d9
2009-10-20 12:59:15 -07:00
Android (Google) Code Review
fc5b5aecde Merge change I1a00abb0 into eclair-sdk
* changes:
  Fix a deadlock when ADT starts, starts building projects, and load the SDK at the same time.
2009-10-19 17:24:34 -04:00
Xavier Ducrohet
1a00abb0ae Fix a deadlock when ADT starts, starts building projects, and load the SDK at the same time. 2009-10-19 12:56:57 -07:00
Xavier Ducrohet
af49663340 Add save/load for the user-made Layout Devices. (do not merge)
Also added support for mcc/mnc in the schema.
2009-10-16 17:49:45 -07:00
Android (Google) Code Review
8dd4e92cc6 Merge change I74fdf8c6 into eclair
* changes:
  Fix device dpi handling in the Layout device parsing/UI.
2009-10-14 18:58:02 -04:00
Xavier Ducrohet
3cfed4b8c4 Fix device dpi handling in the Layout device parsing/UI.
Change-Id: I74fdf8c62a7b005e40e1817d9f39c59d8f99c070
2009-10-14 15:25:15 -07:00
Raphael
44098d157c SDK: Remove STOPSHIP keyword.
Change-Id: Idad5a0ab0f31c3e513ce19d914e2eb686078d44f
2009-10-14 12:11:56 -07:00
Xavier Ducrohet
8f49a988e3 UI to manage/create custom Layout Devices.
Change-Id: Idc447b4136a6f709d7a665321af68de552ec613a
2009-10-13 18:35:13 -07:00
Xavier Ducrohet
98fcd41e1f Fix best match resource selection when there's only one match.
Was using the wrong index.

Change-Id: I7d761ffa553f0aeec176a4752185dde238991e5e
2009-10-05 12:15:08 -07:00
Android (Google) Code Review
1061c0c7dc Merge change I69afafa4 into eclair
* changes:
  ADT: Create project from existing sample in New Project Wizard
2009-10-02 22:52:31 -04:00
Raphael
badc593c5e ADT: Create project from existing sample in New Project Wizard
The UI workflow:
- user selects the new "Create project from existingsample" radio button
- user selects an SDK target in the NPW
- a popup is filled with all available samples

This also fixes 2 edge cases:
- when the selected sample contains a build|default.propertie that is
  a base of the currently selected SDK target, don't reset it.
- when the user manually changes the project name or the app name for
  the sample, simply empty the fields and the next selected sample
  will recompute the adequate names. Any non-empty user input is never
  overridden.

SDK BUG 2121819

Change-Id: I69afafa460b86942046ef6baca3d4c7ee7dbe97d
2009-10-02 19:47:26 -07:00
Xavier Ducrohet
90ee703e94 Fix resource resolution in the graphical layout editor.
Resource with qualifiers take precedence over the ones without
even if the qualifiers are not present on the requested configuration.

Change-Id: I0d19889064e8031179ea6ee13c93a4198fe971fd
2009-10-02 19:07:09 -07:00
Raphael
2ace885b29 ADT Manifest Editor: Fix for uses-sdk dup that won't go away.
It was a display issue only, meaning the actual XML node was
being deleted but the Ui model was not updated properly. The
actual cause is that this is a mandatory node, and mandatory
nodes must stay as "fake nodes" in the Ui model. However
only one such node needs to stay in the hierarchy.

SDK BUG 2147112

Change-Id: I68e3d343bb95169865ad8dcad77004cbd51fafc3
2009-10-01 14:17:02 -07:00
Xavier Ducrohet
227b8768fa Load default GLE device profiles from the SDK.
Change-Id: Ife64397692912f892ec81af8237ac31914830be9
2009-09-30 23:01:19 -07:00
Xavier Ducrohet
8677a1704e Replace icon template with new style and multiple densities.
The icon in the templates of ADT was medium density only.
I added new densities (high and low), as well as updated to
the new Eclair style. Also added a version for Ant project.

Updated ADT and sdklib to deal with creating new projects
with all 3 icons.

In case of Ant project, this is done only if the icons
are present in the target platforms.

For ADT, this is done only if the project target donut
or later. Older project still have only one icon located
in drawable/

Change-Id: I77069a1e4902ef395d490526aabc40a26e33d4ca
2009-09-30 20:46:00 -07:00
Xavier Ducrohet
f0303d8d5c Add support for xdpi and ydpi in the device config for the GLE.
Change-Id: Ie905f9b586ac5f58e40e86232fbafeaacf6a0c51
2009-09-30 11:57:36 -07:00
Android (Google) Code Review
603899e5a9 Merge change I95a34d28 into eclair
* changes:
  ADT XML String Refactoring: fix refusing to edit @+id/blah.
2009-09-29 21:05:44 -04:00
Raphael
c737e421e9 ADT XML String Refactoring: fix refusing to edit @+id/blah.
It correctly only refuses to edit @string/blah now.

This CL also does a bit of refactoring; I extracted some methods
and a class to make it a bit easier to read.

BUG 2066460

Change-Id: I95a34d28d6390ab0cc075f05ea83ceec04993ae9
2009-09-29 16:43:53 -07:00
Raphael
9b8a8056d1 Add xdpi and ydpi to layout-configs XML Schema.
Also validate that whitespace around tokens is accepted.

BUG 2138329

Change-Id: Id5af7cf2b0689f05327a0cf0b17a525ceba78a12
2009-09-29 14:41:45 -07:00
Xavier Ducrohet
596f3b8d91 Fix NPE when opening new layout file.
When adding the parsing of the device XML files, I mostly tested with a
layout file already opened when Eclipse launched.

Well it turns out there's a slightly different code path when opening a file
*after* Eclipse has launched. The load of the device UI in the config
selected caused a rendering before the XML model was loaded which ended
up in an NPE in the recomputeLayout method.

Additionnally, I hadn't finalized the code for the GLE2, so this brings it
in line with the GLE1.

Change-Id: Ic86de6e91ca13793aceecb5706bc963edddb9241
2009-09-28 17:59:25 -07:00
Xavier Ducrohet
9e4715e6d9 Fix ADT to use the new sdklib API
ManifestConstants got renamed AndroidManifest but I
forgot to update ADT.

Change-Id: I60d40c63a67968c31789e91f14020c61114907ca
2009-09-28 14:32:34 -07:00
Android (Google) Code Review
eafb009baf Merge change I663d4cb7 into eclair
* changes:
  Update the project creation (from the command line):
2009-09-28 16:33:57 -04:00
Xavier Ducrohet
98b9c10e63 Parse add-on supplied layout devices.
Add-ons are expected to provide a file called devices.xml in their root
folder. The XML schema for this file is
	eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/layout-configs.xsd

I slightly fixed the schema so that normal screen size use the token
"normal" instead of "medium" to match the resource qualifier.

To round up the feature, the following changes are included:
- getEnum in the resource qualifier enum has been made public. There's no
sense in keeping it private and it'll help with people possibly using
valueOf which behaves differently (case sensitive so
ScreenSize.valueOf("normal") fails, while getEnum on the same string succeed.
- Updated the device configuration UI to deal with missing list of
devices while the SDK loads.

Change-Id: Ib1b01007d2ae7fd6398172c3549b2686c33d48be
2009-09-27 21:54:09 -07:00
Xavier Ducrohet
c51d184216 Update the project creation (from the command line):
- Make the distinction between the activity class name, manifest entry,
  fully-qualified name, and tested activity for the template place-holders.
  Test activity names now directly contain the full name (including the
  "Test" prefix) instead of the template adding it.
  This is required by the new 'create test-project'

- New action: create test-project
  This requires a path to the main project. It reads the package, activity
  name and target from the main project.
  The activity is read from the manifest and can be in a more complex form
  than previously expected (for instance .subpackage.MyClass, instead of
  simply MyClass). This is what required the re-work the activity related
  template place holders.
  Options:
   -m --main Location path of the project to test, relative to the new
             project [required]
   -n --name Project name
   -p --path Location path of the new project [required]

   Example: for 2 projects MyProject and MyTests located in the same folder,
            calling from their parent folder.

     android create test-project -p MyTests -m ../MyProject

- build.properties now only gets application.package for older targets
  as the new one get it directly from XPath

- Remove AndroidXPathFactory from the anttasks project as it was already
  in sdklib which is a dependency.

- Removed IntelliJ templates for the SDK. We haven't supported them for
  a while, and now that IntelliJ has built-in support for Android, it's
  not that useful anymore.

While there is the command line parameters for 'update test-project'
it's not yet implemented.

Change-Id: I663d4cb7f439bb2abfe866f893e58f4d13aff975
2009-09-27 18:08:00 -07:00
Raphael
48f27946d5 XML Schema for layout configurations.
The only changes to the original XML sample:
- the root element is called "layout-configs" (plural for container).

- the <default> and <config> elements must be defined in that order:
 - 0..1 of <default>
   folowed by
 - 1..n of <config>
It's invalid for the <device> node to be empty.

default/config are defined by a <xsd:sequence>, which imposes the
strict ordering. At first I used an <xsd:choice> which does not
impose any ordering but then it becomes possible to define an
empty <device> element. I'd rather live with the strict ordering
(which also makes sense anyway) and enforce non-empty <device>
elements in the schema.

BUG 2138329

Change-Id: I581afb1d72825ae79df00d81c74c80a2a18680ad
2009-09-27 16:44:45 -07:00
Android (Google) Code Review
b936faf6e6 Merge change 26773 into eclair
* changes:
  Disable clipping toggle when not supported.
2009-09-24 02:35:11 -04:00
Android (Google) Code Review
b9b298782a Merge change 26740 into eclair
* changes:
  Add warning on mismatch minSdkVersion.
2009-09-24 02:34:55 -04:00
Xavier Ducrohet
0d3e110b36 Disable clipping toggle when not supported.
This is only supported in Eclair+, so the toggle button
is disable if the edited file is donut or before.

Change-Id: I8bf1f8a8aa3604f269cb226d788c5e1438a5ae0b
2009-09-23 20:40:36 -07:00
Xavier Ducrohet
d0306ecd58 Add warning on mismatch minSdkVersion.
This is for both Ant and ADT.
For Ant, also added a check for non-integer values when the platform
is not a preview.

BUG:2118374

Change-Id: Ic8ec533d66a31d9e4b51c9c38b5eaab97bca7414
2009-09-23 20:38:33 -07:00
Android (Google) Code Review
61676a4061 Merge change 26540 into eclair
* changes:
  Make the Density enum use the int value from the api Density enum.
2009-09-23 23:34:38 -04:00
Xavier Ducrohet
019685753e Hide APK split UI (not ready yet)
Change-Id: I2ace823139710e836c72cc323427024b54384e38
2009-09-23 18:22:49 -07:00
Xavier Ducrohet
252ad3146a Make the Density enum use the int value from the api Density enum.
Change-Id: I13cace9a3fd7d17171ebe1e8b98c31adfa8509dc
2009-09-23 15:11:32 -07:00
Xavier Ducrohet
350187ab93 Create Density based resource values when needed.
This will let the layoutlib know when to scale bitmaps
that are not in the native density of the rendering.

Change-Id: I08c99666460b5b5a3ed8d0aac7fa1b7c0136fd6b
2009-09-22 19:51:52 -07:00
Xavier Ducrohet
cf51575c5e Fix the qualifier match algorithm.
Add proper support for density and keyboard state match.

Change-Id: I410aba52ee0f0d9df31fa2abdc9485054595263f
2009-09-22 16:46:19 -07:00
Xavier Ducrohet
14fff84f14 Add support for Keyboard state "Soft"
Change-Id: Ief65b3988973fb3b3d9edbbb99df9354ffe85663
2009-09-22 14:16:26 -07:00
Xavier Ducrohet
54bc097702 Update the SDK/AVD manager toolbar icon tooltip to be consistent.
Change-Id: Ie4c98537035e11543dd22b870880d52506ca1b99
2009-09-21 17:20:48 -07:00
Raphael
fc033f2836 ADT GLE: support multiple selection and alternate selection.
Change-Id: Ia7ce5fb2365898fdcae73eacbaf6d08b091d7586
2009-09-09 23:53:01 -07:00
Xavier Ducrohet
2cc9724024 GLE: remove mcc/mnc, add clipping support.
Change-Id: I9fc2ee167436ba234c6f09b1635f45b34b461c2e
2009-09-08 11:27:56 -07:00
Raphael
9135db1149 ADT: Display selection and mouse hover in GLE canvas.
Change-Id: Icc2f8331a099905d6e1aaa52b36cc17a7190cc4b
2009-09-04 17:59:56 -07:00
Android (Google) Code Review
0eb96d6433 Merge change 24047 into eclair
* changes:
  ADT: fix an NPE that can happen when an XML file resource is being refreshed by Eclipse whilst the SDK is not finished loading.
2009-09-04 17:56:34 -07:00
Raphael
6e1ee87955 ADT: fix an NPE that can happen when an XML file resource is being
refreshed by Eclipse whilst the SDK is not finished loading.

Change-Id: I970255925d98f7b84a726fa37bf1fef3d25ab520
2009-09-04 17:14:37 -07:00
Xavier Ducrohet
3ce85131be Add method profiling support to DDMS.
New button allows to start/stop tracing. When clicking stop, DDMS downloads
the trace file and starts Traceview.

Also refactored some common parts of the HPROF and tracing handlers into a
common class. The goal is to have a default, extensible implementation
of the HPROF handler that DDMS and the plug-in can reuse. This will reduce
duplicated code.

Change-Id: Ifc48926c7f6f1c3ea49a4aa94053664be83cbb06
2009-09-03 16:01:27 -07:00
Raphael
b1e9793d66 ADT GLE: change error display to a separate sash.
This allows GEP to display both the latest error and the latest
successful rendering. The error still needs an icon and the
canvas will need to be grayed or something.

Also the LayoutCanvas will directly use the ILayoutResult and we
won't need to custom EditData in UiElementNode so the correspond
method is @deprecated (but obviously still supported for GLE1.)

Change-Id: Ia3afed836755dbd84a4511eaed0782c85a383ac9
2009-09-02 12:39:24 -07:00
Raphael
3a5851d125 ADT: GraphicalEditorPart is the new GLE2.
This CL represents the base for the new "Graphical Editor Part".

First, GLE2 has been renamed in GraphicalEditorPart. That's the
final name, I swear I won't change it again (until next month that is.)

The editor part has 3 composites: the top ConfigConfiguration
(same as usual, reused as-is), a new PaletteComposite and a new
LayoutCanavas. This last one displays the rendering image and
will deal with interactivity.

The LayoutCanvas is actually stacked with a label which displays
the rendering error. After a rendering, either the error or the
canvas is visible, depending on the success of the operation.
That would make it easier to have a different mechanism, for example
the error could be next to the last known rendering, they don't
have to be mutually exclusive.

It is worth noting that GraphicalEditorPart is 95% similar to
the GLE1, reusing all the glue code that we had to handle
layout requestes, refresh requests, sdk/framework load listeners,
configuration and file input changes, etc.

Both PaletteComposite and LayoutCanvas are currently embryonic
at best, just to make sure the editor part is structured correctly.

Change-Id: I36c2ae4d85a68e68a349adc63a718f06375e12c5
2009-08-27 09:52:49 -07:00
Xavier Ducrohet
338bc1cc45 Move from arbitrary resource filters to fix ones
Resource filters are used when generating additional APK containing only
specific resources.
The previous UI allowed for any type of filters, but we are moving to a
simpler way with fixed filters.
The first one is the density. Selecting the filter will generate 4 APKs per
application: default (all resources), hdpi (only hdpi/nodpi and default
resources), mdpi, ldpi.
2009-08-25 17:17:15 -07:00
Raphael
b8a74f4551 ADT: Fix some potential NPE in the configuration composite.
This is just based on Eclipse static analysis of potential null pointers.
It doesn't mean we were ever going to have any NPE there.

Change-Id: I2a326048d2eb6afff7598f9300f48e35495ff3c2
2009-08-25 16:19:25 -07:00
Raphael
5837c3cc34 ADT: Tag classes with "@since GLE1"
This adds a @since GLE1 to all classes involved in the current GLE
and a @since GLE2 to the new classes. The idea is that both classes
are going to be mixed in the same packages and it will help later
to remove the old GLE by just searching for this specific tag.

The alternative would be to move the classes in a sub-package
layout.gle1 vs layout.gle2, but that seems unecessary.

Change-Id: I577cd81819db4c6e0209ebbd910a393fc2182619
2009-08-25 15:29:51 -07:00
Raphael
59aac85f63 ADT: Skeleton for GLE2.
This refactors the GLE base class into an interface, to make it
possible to not depend on GEF at all.

The GLE2 editor part displays and does nothing. It's just an empty shell.
To enable, setenv USE_GLE2 to anything. Unset to remove it.

Change-Id: I7a95b4a1a5a8ddf5a3f18acf7a04b1f9b3439655
2009-08-24 20:16:28 -07:00
Xavier Ducrohet
8535518cb2 Device hardware profile for config selector in GLE
- Built-in device list for now
- Config selector in GLE is changed to only have
  - MCC/MNC
  - Locale
  - Device List
  - Device config.
2009-08-21 15:03:54 -07:00
Xavier Ducrohet
9f944d673b Add basic support for full height rendering. 2009-08-21 11:32:17 -07:00