OSDN Git Service

Custom listview layouts
authorTor Norbye <tnorbye@google.com>
Tue, 12 Apr 2011 06:05:47 +0000 (23:05 -0700)
committerTor Norbye <tnorbye@google.com>
Wed, 20 Apr 2011 23:47:11 +0000 (16:47 -0700)
commit40c1413a861cefb3bfb2cd200c89ffdf84fdc308
treeb79cbad4ce44f12508563dfc3476ba6f0c729cf2
parent8fedf312c7cf2075f2bf9ef07b8757d02de2ad82
Custom listview layouts

This changeset adds support for user-configured layouts in ListViews
and ExpandableListViews.

There is a new "Preview List Content" pullright menu when you right
click on a ListView in the layout canvas. The menu contains links to
configure
- the layout to use for list view items
- the layout to use as a header
- the layout to use as a footer
- as well as a number of pre-configured framework layouts for common
  arrangements like 2-item list, 1-item list, checked list, etc.

The selected layout is persisted as an inline comment in the layout
XML. (Current bug: When you drag elements around in the layout,
comment nodes are not preserved, meaning you will lose your list view
render type as well.)

This changeset also adds "Clear" to the resource chooser, which makes
it possible to clear a previously set value (until this, choosing
nothing would simply abort the selection.) This makes it possible to
remove a chosen header/footer.

Change-Id: I611b00f627c5773f3fe2443a6e16c29388687b36
15 files changed:
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageButtonRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageViewRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/IncludeRule.java
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/AndroidXmlEditor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DynamicContextMenu.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/LayoutMetadata.java [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ListViewTypeMenu.java [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java
eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml [new file with mode: 0644]