diff options
author | Michael Kolb <kolby@google.com> | 2012-04-16 13:30:28 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2012-04-16 14:36:28 -0700 |
commit | da580634265a0add98d3c16b07103edbe724a5b3 (patch) | |
tree | d5c1eb6fd61496240903cbfe6401145e0c1f805f /src/com/android/browser/BaseUi.java | |
parent | 891aded02d0f774f418aa10b169520667f8acddf (diff) | |
download | packages_apps_Browser-da580634265a0add98d3c16b07103edbe724a5b3.zip packages_apps_Browser-da580634265a0add98d3c16b07103edbe724a5b3.tar.gz packages_apps_Browser-da580634265a0add98d3c16b07103edbe724a5b3.tar.bz2 |
fix titlebar disappearing on tab switch
Bug: 6343476
Consolidate some quickcontrols code and set titlebar for BrowserWebView
before attaching
Change-Id: I3bc8100e3905538aae73be7a07fb611702c5e54b
Diffstat (limited to 'src/com/android/browser/BaseUi.java')
-rw-r--r-- | src/com/android/browser/BaseUi.java | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index 652f9d7..54b2f18 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -32,7 +32,6 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.TextUtils; -import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.Menu; @@ -112,6 +111,7 @@ public abstract class BaseUi implements UI { protected boolean mUseQuickControls; protected TitleBar mTitleBar; private NavigationBarBase mNavigationBar; + protected PieControl mPieControl; public BaseUi(Activity browser, UiController controller) { mActivity = browser; @@ -196,6 +196,21 @@ public abstract class BaseUi implements UI { return false; } + @Override + public void setUseQuickControls(boolean useQuickControls) { + mUseQuickControls = useQuickControls; + mTitleBar.setUseQuickControls(mUseQuickControls); + if (useQuickControls) { + mPieControl = new PieControl(mActivity, mUiController, this); + mPieControl.attachToContainer(mContentView); + } else { + if (mPieControl != null) { + mPieControl.removeFromContainer(mContentView); + } + } + updateUrlBarAutoShowManagerTarget(); + } + // Tab callbacks @Override public void onTabDataChanged(Tab tab) { @@ -247,9 +262,19 @@ public abstract class BaseUi implements UI { } } mActiveTab = tab; - WebView web = mActiveTab.getWebView(); + BrowserWebView web = (BrowserWebView) mActiveTab.getWebView(); updateUrlBarAutoShowManagerTarget(); attachTabToContentView(tab); + if (web != null) { + // Request focus on the top window. + if (mUseQuickControls) { + mPieControl.forceToTop(mContentView); + web.setTitleBar(null); + } else { + web.setTitleBar(mTitleBar); + mTitleBar.onScrollChanged(); + } + } mTitleBar.bringToFront(); tab.getTopWindow().requestFocus(); setShouldShowErrorConsole(tab, mUiController.shouldShowErrorConsole()); |