diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java index 81fdfbab13b0..a9323909f11a 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java @@ -215,22 +215,24 @@ public class ResizeOperation implements EditOperation { myTextFeedback.dimension("dp"); } } - else { - if (staticText.length() > 2) { - int index = staticText.length() - 2; - String dimension = staticText.substring(index); - if (ArrayUtil.indexOf(ResourceRenderer.DIMENSIONS, dimension) != -1) { - myTextFeedback.append(staticText.substring(0, index)); - myTextFeedback.dimension(dimension); - } - else { - myTextFeedback.append(staticText); - } + else if (staticText.length() > 3 && staticText.endsWith("dip")) { + myTextFeedback.append(staticText.substring(0, staticText.length() - 3)); + myTextFeedback.dimension("dip"); + } + else if (staticText.length() > 2) { + int index = staticText.length() - 2; + String dimension = staticText.substring(index); + if (ArrayUtil.indexOf(ResourceRenderer.DIMENSIONS, dimension) != -1) { + myTextFeedback.append(staticText.substring(0, index)); + myTextFeedback.dimension(dimension); } else { myTextFeedback.append(staticText); } } + else { + myTextFeedback.append(staticText); + } } private static boolean snapToWidth(Rectangle bounds, Dimension size, int delta) { diff --git a/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java b/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java index 0d80fab9a837..e78f5200eb48 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java +++ b/plugins/android-designer/src/com/intellij/android/designer/propertyTable/editors/ResourceEditor.java @@ -273,6 +273,7 @@ public class ResourceEditor extends PropertyEditor { } if (myIsDimension && !value.startsWith("@") && + !value.endsWith("dip") && !value.equalsIgnoreCase("wrap_content") && !value.equalsIgnoreCase("fill_parent") && !value.equalsIgnoreCase("match_parent")) { diff --git a/plugins/android-designer/src/com/intellij/android/designer/propertyTable/renderers/ResourceRenderer.java b/plugins/android-designer/src/com/intellij/android/designer/propertyTable/renderers/ResourceRenderer.java index 4f88da0289ae..6742d265878d 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/propertyTable/renderers/ResourceRenderer.java +++ b/plugins/android-designer/src/com/intellij/android/designer/propertyTable/renderers/ResourceRenderer.java @@ -90,12 +90,21 @@ public class ResourceRenderer extends AbstractResourceRenderer { myColoredComponent.append(value.substring(0, prefix), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); myColoredComponent.append(value.substring(prefix), textStyle(component, value, system, colorValue)); } - else if (myFormats.contains(AttributeFormat.Dimension) && value.length() > 2) { - int index = value.length() - 2; - String dimension = value.substring(index); - if (ArrayUtil.indexOf(DIMENSIONS, dimension) != -1) { - myColoredComponent.append(value.substring(0, index)); - myColoredComponent.append(dimension, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + else if (myFormats.contains(AttributeFormat.Dimension)) { + if (value.length() > 3 && value.endsWith("dip")) { + myColoredComponent.append(value.substring(0, value.length() - 3)); + myColoredComponent.append("dip", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + } + else if (value.length() > 2) { + int index = value.length() - 2; + String dimension = value.substring(index); + if (ArrayUtil.indexOf(DIMENSIONS, dimension) != -1) { + myColoredComponent.append(value.substring(0, index)); + myColoredComponent.append(dimension, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + } + else { + myColoredComponent.append(value); + } } else { myColoredComponent.append(value);