aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2010-11-08 11:21:24 -0800
committerTor Norbye <tnorbye@google.com>2010-11-09 16:32:28 -0800
commit23258d5ae21d164049eef14eebb2ef28a43a7b40 (patch)
tree998d756150724474885f12cbe8b680d7f677f0eb /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api
parente00a18ff06a4b0f2862e541fe61f10f3bf6b6b2d (diff)
downloadsdk-23258d5ae21d164049eef14eebb2ef28a43a7b40.zip
sdk-23258d5ae21d164049eef14eebb2ef28a43a7b40.tar.gz
sdk-23258d5ae21d164049eef14eebb2ef28a43a7b40.tar.bz2
Add transient visibility mode for empty containers
When you add a new container, such as a LinearLayout, it is usually invisible. The reason for this is that an empty layout has 0 width and 0 height. There are two existing features in the layout editor to deal with this: (1) Outline mode, which renders rectangles around all views, and (2) Padding mode, which adds 10 pixels of padding to all views. In combination, these two modes will create a rectangle for empty layouts making them visible and user-manipulatable -- you can for example select or drop into them. This changeset attempts to make dealing with these types of containers easier and more discoverable. It adds a new temporary mode where empty containers (and only empty containers) are automatically padded and have their outlines painted. And more importantly, this is only done in some limited scenarios: When you drag into, or drag within, the layout canvas. As soon as you finish the drag, empty containers disappear again. Unlike padding mode, we don't enlarge the design surface itself, since this mode comes and goes easily and frequently. In addition to this, there is special handling for selection. If you select a zero-sized element (which for example is automatically done when you drop a new layout, and which can also be done by clicking in the outline), then the element is also revealed similar to the show-empty mode, but in this case only the selected item and not any other invisible containers are shown. Change-Id: Ibf3ec6a080a50a8f0f55919c3d3e6c4d2890468d
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java
index 335e565..0938afa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java
@@ -91,11 +91,17 @@ public enum DrawingStyle {
HELP,
/**
- * The style used to raw illegal/error/invalid markers
+ * The style used to draw illegal/error/invalid markers
*/
INVALID,
/**
+ * The style used to draw empty containers of zero bounds (which are padded
+ * a bit to make them visible during a drag or selection).
+ */
+ EMPTY,
+
+ /**
* A style used for unspecified purposes; can be used by a client to have
* yet another color that is domain specific; using this color constant
* rather than your own hardcoded value means that you will be guaranteed to