aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-09-19 09:09:57 -0700
committerTor Norbye <tnorbye@google.com>2012-09-20 10:21:13 -0700
commitf48bde52e60fefec0763cad1b45bc1dcd1bf0841 (patch)
tree160870cc163cb2a7fc7411b27baf93ae2206dc77 /common
parent0be1d50d12ff9f241c2d9afc9e62da7f323aae5b (diff)
downloadsdk-f48bde52e60fefec0763cad1b45bc1dcd1bf0841.zip
sdk-f48bde52e60fefec0763cad1b45bc1dcd1bf0841.tar.gz
sdk-f48bde52e60fefec0763cad1b45bc1dcd1bf0841.tar.bz2
Validate user edits in XML files
Around ADT 15 or so we introduced a bunch of optimizations to run AAPT much less frequently, since with large projects it can take a long time, and end up blocking the UI if you try to save twice. Unfortunately, one side effect of this change is that if you edit only the *value* of an attribute, we will not re-run aapt, which means that if you set the value to a bogus value, you will get no error message until the next time AAPT runs (usually when you try to run). This changeset fixes this. We already have the attribute metadata which aapt uses, so now, when an XML file is changed and saved, we process it with an XML pull parser, and validate all the Android namespace attributes. If any are found to not be correct, then we request a full AAPT process, which will then display errors as appropriate. Change-Id: I374c19648e29c27c6d82616b3ee602cb2343cd3a
Diffstat (limited to 'common')
-rw-r--r--common/src/com/android/SdkConstants.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/src/com/android/SdkConstants.java b/common/src/com/android/SdkConstants.java
index 1aa3853..cf64967 100644
--- a/common/src/com/android/SdkConstants.java
+++ b/common/src/com/android/SdkConstants.java
@@ -816,6 +816,9 @@ public final class SdkConstants {
public static final String UNIT_DIP = "dip"; //$NON-NLS-1$
public static final String UNIT_SP = "sp"; //$NON-NLS-1$
public static final String UNIT_PX = "px"; //$NON-NLS-1$
+ public static final String UNIT_IN = "in"; //$NON-NLS-1$
+ public static final String UNIT_MM = "mm"; //$NON-NLS-1$
+ public static final String UNIT_PT = "pt"; //$NON-NLS-1$
// Filenames and folder names
public static final String ANDROID_MANIFEST_XML = "AndroidManifest.xml"; //$NON-NLS-1$