diff options
author | Tor Norbye <tnorbye@google.com> | 2011-12-22 12:11:31 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-22 12:11:31 -0800 |
commit | c709b3f74e3353f3df6b0d9371cc761a853d3643 (patch) | |
tree | 8e902e0373f6ab58cd9d73abd1969df28e9f45cc | |
parent | 1cdf905e733cdf5b4dfd92e34c02547a8a6ff630 (diff) | |
parent | 51ff6d71ec293b76b7d770053832aa952d0889fa (diff) | |
download | sdk-c709b3f74e3353f3df6b0d9371cc761a853d3643.zip sdk-c709b3f74e3353f3df6b0d9371cc761a853d3643.tar.gz sdk-c709b3f74e3353f3df6b0d9371cc761a853d3643.tar.bz2 |
Merge "Set android:ems="10" for EditTexts on drop"
2 files changed, 7 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java index 4f76111..7407854 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java @@ -16,6 +16,8 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_EMS; import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.REQUEST_FOCUS; import com.android.ide.common.api.IMenuCallback; @@ -42,6 +44,10 @@ public class EditTextRule extends BaseViewRule { // Add <requestFocus> node.appendChild(REQUEST_FOCUS); } + + if (parent.getBounds().w >= 320) { + node.setAttribute(ANDROID_URI, ATTR_EMS, "10"); //$NON-NLS-1$ + } } } 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 e47bb5b..c6a5ba8 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 @@ -251,6 +251,7 @@ public class LayoutConstants { public static final String ATTR_WEIGHT_SUM = "weightSum"; //$NON-NLS-1$ public static final String ATTR_BASELINE_ALIGNED = "baselineAligned"; //$NON-NLS-1$ public static String ATTR_ORIENTATION = "orientation"; //$NON-NLS-1$ + public static String ATTR_EMS = "ems"; //$NON-NLS-1$ public static String VALUE_HORIZONTAL = "horizontal"; //$NON-NLS-1$ |