OSDN Git Service

Add palette variations of widgets
authorTor Norbye <tnorbye@google.com>
Mon, 31 Jan 2011 04:52:05 +0000 (20:52 -0800)
committerTor Norbye <tnorbye@google.com>
Thu, 3 Mar 2011 21:49:57 +0000 (13:49 -0800)
commite7abbed2fe84c25bcd6d68cef4140963c10a1e5d
tree57bacfd0ea0814c55b2ab0f821d78560848e3d00
parent9be69095bcb0d56373c0a0e52f0b3840aa0df127
Add palette variations of widgets

This changeset adds new items to the palette which are just variations
of an existing widget but with different initial attributes. In
particular:

* Instead of just LinearLayout there are two versions of it:
   LinearLayout (Vertical) and LinearLayout (Horizontal)

* The ProgressBar has 3 variations: Large, Small, and Horizontal.  The
  horizontal ProgressBar looks like the SeekBar, without at thumb, so
  the SeekBar is moved next to the progress bar.

* There is a new palette category, "Text Fields", which contains a
  number of different initializations of the EditText's "inputType"
  attribute - for textual and numeric passwords, for names and e-mail
  and postal addresses, for phone numbers, for negative and decimal
  numbers, etc.

* Since LinearLayout is so common, the outline handles it specially to
  ensure that we show a horizontal or a vertical icon depending on the
  orientation attribute of the specific element rather than the
  generic descriptor icon.

There are various changes to the palette icon preview and drag preview
etc to handle these changes. In particular, the category
initialization code had to be rewritten to be able to handle
variations (since for example the text field appears in multiple
categories, so the old assumption that each view had an assigned
category was no longer true.)

This changeset also extracts a constant for the "android:" literal
used in many places in the code, and renames the existing "android"
namespace constant.

Change-Id: Ibbc3dbd34c551594421c3de034cdccea6a66eba0
23 files changed:
eclipse/plugins/com.android.ide.eclipse.adt/icons/SearchView.png
eclipse/plugins/com.android.ide.eclipse.adt/icons/VerticalLinearLayout.png [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtils.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ElementDescriptor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/ViewElementDescriptor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/PaletteMetadataDescriptor.java [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/extra-view-metadata.xml
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/rendering-configs.xml
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/descriptors/MenuDescriptors.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiListAttributeNode.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/descriptors/XmlDescriptors.java