aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-02-11 01:32:19 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-02-11 01:32:19 +0000
commitfd902f36b762ee7f5eced4a49b40b331f98cac37 (patch)
treeb09cf1b276e58cec9e0f8879531a940348e3bde9
parent643ee5f7146fa1755fcaa258582dd869fd3dffed (diff)
parenta222fbdb7bd2cd883311c754552ad1e1a4d84814 (diff)
downloadsdk-fd902f36b762ee7f5eced4a49b40b331f98cac37.zip
sdk-fd902f36b762ee7f5eced4a49b40b331f98cac37.tar.gz
sdk-fd902f36b762ee7f5eced4a49b40b331f98cac37.tar.bz2
Merge "65351: Applying auto-format to xml file inside res-->xml" into idea133
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java
index 9f69e41..4cab419 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java
@@ -559,6 +559,11 @@ public class AndroidXmlFormattingStrategy extends ContextBasedFormattingStrategy
String[] segments = resourceFolder.split("-"); //$NON-NLS-1$
ResourceType type = ResourceType.getEnum(segments[0]);
if (type != null) {
+ // <resources> files found in res/xml/ should be formatted as
+ // resource files!
+ if (type == ResourceType.XML && style == XmlFormatStyle.RESOURCE) {
+ return style;
+ }
style = EclipseXmlPrettyPrinter.get(type);
}
}