aboutsummaryrefslogtreecommitdiff
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-01-20 20:58:25 -0800
committerTor Norbye <tnorbye@google.com>2012-01-23 07:37:53 -0800
commitfefa8b7d47b787d2250dc2fd0f35cac5540241e2 (patch)
treedb67ea2694d46698ebe93f344e92c4e0000af2f6 /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common
parent121e7e305d8dc179bce1267b0ccef2741706262d (diff)
downloadsdk-fefa8b7d47b787d2250dc2fd0f35cac5540241e2.tar.gz
Add quick fix for the UseCompoundDrawable lint warning
This changeset adds a quickfix for the "Use Compound Drawable" lint warning. That warning identifies a LinearLayout which contains exactly one TextView and one ImageView (in either order, and the linear layout can be in either orientation), and suggests replacing it by just the single TextView along with a drawable attribute. The description alone wasn't clear, so the quickfix performs the conversion automatically. In addition to the conversion it also needs to transfer any layout param references from the old LinearLayout to the TextView (and assign it an id if necessary), so the quickfix is implemented as a visual refactoring. It's also made available from the Visual Refactoring menu. This changeset also updates a couple of unrelated golden files in the refactoring unit tests to track a message change a few months back. Change-Id: Iecb544d196fdd4bcabf13a3fdb82ef1ea063f4c2
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java
index c6a5ba841..1b9f815f2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java
@@ -83,6 +83,12 @@ public class LayoutConstants {
public static final String ATTR_LAYOUT_MARGIN_TOP = "layout_marginTop"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_MARGIN_BOTTOM = "layout_marginBottom"; //$NON-NLS-1$
+ // TextView
+ public static final String ATTR_DRAWABLE_RIGHT = "drawableRight"; //$NON-NLS-1$
+ public static final String ATTR_DRAWABLE_LEFT = "drawableLeft"; //$NON-NLS-1$
+ public static final String ATTR_DRAWABLE_BOTTOM = "drawableBottom"; //$NON-NLS-1$
+ public static final String ATTR_DRAWABLE_TOP = "drawableTop"; //$NON-NLS-1$
+
// RelativeLayout layout params:
public static final String ATTR_LAYOUT_ALIGN_LEFT = "layout_alignLeft"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_ALIGN_RIGHT = "layout_alignRight"; //$NON-NLS-1$
@@ -242,6 +248,12 @@ public class LayoutConstants {
/** The fully qualified class name of a Space */
public static final String FQCN_SPACE = "android.widget.Space"; //$NON-NLS-1$
+ /** The fully qualified class name of a TextView view */
+ public static final String FQCN_TEXT_VIEW = "android.widget.TextView"; //$NON-NLS-1$
+
+ /** The fully qualified class name of an ImageView view */
+ public static final String FQCN_IMAGE_VIEW = "android.widget.ImageView"; //$NON-NLS-1$
+
public static final String ATTR_SRC = "src"; //$NON-NLS-1$
// like fill_parent for API 8