From a222fbdb7bd2cd883311c754552ad1e1a4d84814 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Mon, 10 Feb 2014 17:26:20 -0800 Subject: 65351: Applying auto-format to xml file inside res-->xml Change-Id: Icf21eba2f22d5c0e15e924ac40726138069dab48 --- .../internal/editors/formatting/AndroidXmlFormattingStrategy.java | 5 +++++ 1 file changed, 5 insertions(+) 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) { + // files found in res/xml/ should be formatted as + // resource files! + if (type == ResourceType.XML && style == XmlFormatStyle.RESOURCE) { + return style; + } style = EclipseXmlPrettyPrinter.get(type); } } -- cgit v1.1