diff options
author | Tor Norbye <tnorbye@google.com> | 2011-01-20 14:39:23 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-01-20 14:39:23 -0800 |
commit | 648ef38f50957007e9296946d20e55939605db48 (patch) | |
tree | 02aef4e85ea4a13e9d1170dba872a7672794c46b /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java | |
parent | 3a6b7dce85229abeb836605102913081caa078e1 (diff) | |
download | sdk-648ef38f50957007e9296946d20e55939605db48.tar.gz |
Tweak TabHost drop handler
Instead of creating a single tab, create 3 tabs instead, and pick a
better id since it's used as the tab label by the designtime TabSpec
creator.
Change-Id: I35ecb4ec8642431ff76a02d52f5194efd5909774
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java')
-rwxr-xr-x | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java index 102911281..92decde30 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java @@ -67,10 +67,13 @@ public class TabHostRule extends IgnoredLayoutRule { frame.setAttribute(ANDROID_URI, ATTR_LAYOUT_HEIGHT, fillParent); frame.setAttribute(ANDROID_URI, ATTR_ID, "@android:id/tabcontent"); //$NON-NLS-1$ - INode child = frame.appendChild(FQCN_LINEAR_LAYOUT); - child.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, fillParent); - child.setAttribute(ANDROID_URI, ATTR_LAYOUT_HEIGHT, fillParent); - child.setAttribute(ANDROID_URI, ATTR_ID, "@+id/contentlayout"); //$NON-NLS-1$ + for (int i = 0; i < 3; i++) { + INode child = frame.appendChild(FQCN_LINEAR_LAYOUT); + child.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, fillParent); + child.setAttribute(ANDROID_URI, ATTR_LAYOUT_HEIGHT, fillParent); + child.setAttribute(ANDROID_URI, ATTR_ID, + String.format("@+id/tab%d", i + 1)); //$NON-NLS-1$ + } } } |