diff options
author | Cary Clark <cary@android.com> | 2009-09-29 13:00:45 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-09-29 13:16:01 -0400 |
commit | a04645545690d9f637ccae4d043a5a1b8478a832 (patch) | |
tree | de1e919506ff532b6970790dfa73e404a303fa06 | |
parent | 2694e23a55d5ca526fc29534a80a200e2c58698b (diff) | |
download | packages_apps_browser-a04645545690d9f637ccae4d043a5a1b8478a832.zip packages_apps_browser-a04645545690d9f637ccae4d043a5a1b8478a832.tar.gz packages_apps_browser-a04645545690d9f637ccae4d043a5a1b8478a832.tar.bz2 |
don't create the fake title bar when getGlobalVisible fails
If getGlobalVisibleFails, the visible rectangle top is
assumed to be zero, as if the status bar has no height. The
fake title bar is then drawn underneath the actual status
bar. Bail on the fake title bar creation if the status bar
can't be measured.
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index f898d11..15f986e 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -990,6 +990,13 @@ public class BrowserActivity extends Activity if (mFakeTitleBar == null && mActiveTabsPage == null && !mActivityInPause && decor != null && decor.getWindowToken() != null) { + Rect visRect = new Rect(); + if (!mBrowserFrameLayout.getGlobalVisibleRect(visRect)) { + if (LOGD_ENABLED) { + Log.d(LOGTAG, "showFakeTitleBar visRect failed"); + } + return; + } final WebView webView = getTopWindow(); mFakeTitleBar = new TitleBar(this); mFakeTitleBar.setTitleAndUrl(null, webView.getUrl()); @@ -1017,9 +1024,7 @@ public class BrowserActivity extends Activity // XXX : Without providing an offset, the fake title bar will be // placed underneath the status bar. Use the global visible rect // of mBrowserFrameLayout to determine the bottom of the status bar - Rect rectangle = new Rect(); - mBrowserFrameLayout.getGlobalVisibleRect(rectangle); - params.y = rectangle.top; + params.y = visRect.top; // Add a holder for the title bar. It also holds a shadow to show // below the title bar. if (mFakeTitleBarHolder == null) { |