diff options
author | Samuel Cheung <samuel.cheung@t-mobile.com> | 2009-03-17 11:06:41 -0700 |
---|---|---|
committer | Josh Guilfoyle <Josh.Guilfoyle@T-Mobile.com> | 2009-07-28 12:55:16 -0700 |
commit | 9d65fe19ec832b96bcded90fba43dfed971cbe2d (patch) | |
tree | 68a353d3edbe5bb2c8c8dd800bb51554fba0ca45 /core/java/android/widget | |
parent | fa61a940bcaef9ac6b70b2f1c698780ddf442a02 (diff) | |
download | frameworks_base-9d65fe19ec832b96bcded90fba43dfed971cbe2d.zip frameworks_base-9d65fe19ec832b96bcded90fba43dfed971cbe2d.tar.gz frameworks_base-9d65fe19ec832b96bcded90fba43dfed971cbe2d.tar.bz2 |
merge latest carousel changes to git
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/TabHost.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java index 4a4cfd7..9ad99b2 100644 --- a/core/java/android/widget/TabHost.java +++ b/core/java/android/widget/TabHost.java @@ -440,6 +440,11 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); return this; } + public TabSpec setCarouselContent(Intent intent) { + mContentStrategy = new IntentContentStrategy(mTag, intent, false); + return this; + } + String getTag() { return mTag; @@ -609,12 +614,20 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); private final String mTag; private final Intent mIntent; + private final boolean mCloseView; private View mLaunchedView; private IntentContentStrategy(String tag, Intent intent) { mTag = tag; mIntent = intent; + mCloseView = true; + } + + private IntentContentStrategy(String tag, Intent intent, boolean closeView) { + mTag = tag; + mIntent = intent; + mCloseView = closeView; } public View getContentView() { @@ -648,7 +661,9 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); public void tabClosed() { if (mLaunchedView != null) { - mLaunchedView.setVisibility(View.GONE); + if (mCloseView) { + mLaunchedView.setVisibility(View.GONE); + } } } } |