summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TabBar.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-02-03 17:54:40 -0800
committerMichael Kolb <kolby@google.com>2011-02-11 15:32:03 -0800
commit7cdc4906fc5852297a9a254c3251ad2f4dead6ee (patch)
treebdfa62eaad0c01cb8fa861f9ccfbb0ff5453073b /src/com/android/browser/TabBar.java
parent203d3806c45420c45e53c6b9f3d503a21bb9717e (diff)
downloadandroid_packages_apps_Gello-7cdc4906fc5852297a9a254c3251ad2f4dead6ee.tar.gz
android_packages_apps_Gello-7cdc4906fc5852297a9a254c3251ad2f4dead6ee.tar.bz2
android_packages_apps_Gello-7cdc4906fc5852297a9a254c3251ad2f4dead6ee.zip
Remove second url bar
Remove the overlay "fake" titlebar by telling the WebView where to render the embedded titlebar Simplify focus handling requires Ic979b641c8cc80acb83eeab49c4f700fc5c50e72 in frameworks/base Change-Id: I7896cd731949fdcc47cd18abfee5ef947b0e8cee
Diffstat (limited to 'src/com/android/browser/TabBar.java')
-rw-r--r--src/com/android/browser/TabBar.java30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java
index d115f1ac..c00e1f51 100644
--- a/src/com/android/browser/TabBar.java
+++ b/src/com/android/browser/TabBar.java
@@ -75,8 +75,6 @@ public class TabBar extends LinearLayout
private Map<Tab, TabView> mTabMap;
- private int mVisibleTitleHeight;
-
private Drawable mGenericFavicon;
private int mCurrentTextureWidth = 0;
@@ -96,7 +94,6 @@ public class TabBar extends LinearLayout
private int mTabOverlap;
private int mAddTabOverlap;
private int mTabSliceWidth;
- private int mTabPadding;
private boolean mUseQuickControls;
public TabBar(Activity activity, UiController controller, XLargeUi ui) {
@@ -122,14 +119,11 @@ public class TabBar extends LinearLayout
mGenericFavicon = res.getDrawable(R.drawable.app_web_browser_sm);
updateTabs(mUiController.getTabs());
-
- mVisibleTitleHeight = 1;
mButtonWidth = -1;
// tab dimensions
mTabOverlap = (int) res.getDimension(R.dimen.tab_overlap);
mAddTabOverlap = (int) res.getDimension(R.dimen.tab_addoverlap);
mTabSliceWidth = (int) res.getDimension(R.dimen.tab_slice);
- mTabPadding = (int) res.getDimension(R.dimen.tab_padding);
mActiveShaderPaint.setStyle(Paint.Style.FILL);
mActiveShaderPaint.setAntiAlias(true);
@@ -198,14 +192,16 @@ public class TabBar extends LinearLayout
mUiController.openTabToHomePage();
} else if (mTabs.getSelectedTab() == view) {
if (mUseQuickControls) {
- if (mUi.isFakeTitleBarShowing() && !isLoading()) {
- mUi.hideFakeTitleBar();
+ if (mUi.isTitleBarShowing() && !isLoading()) {
+ mUi.stopEditingUrl();
+ mUi.hideTitleBar();
} else {
mUi.stopWebViewScrolling();
- mUi.showFakeTitleBarAndEdit();
+ mUi.showTitleBarAndEdit();
}
- } else if (mUi.isFakeTitleBarShowing() && !isLoading()) {
- mUi.hideFakeTitleBar();
+ } else if (mUi.isTitleBarShowing() && !isLoading()) {
+ mUi.stopEditingUrl();
+ mUi.hideTitleBar();
} else {
showUrlBar();
}
@@ -220,7 +216,7 @@ public class TabBar extends LinearLayout
private void showUrlBar() {
mUi.stopWebViewScrolling();
- mUi.showFakeTitleBar();
+ mUi.showTitleBar();
}
void showTitleBarIndicator(boolean show) {
@@ -251,9 +247,11 @@ public class TabBar extends LinearLayout
// callback after fake titlebar is hidden
void onHideTitleBar() {
- showTitleBarIndicator(mVisibleTitleHeight == 0);
Tab tab = mTabControl.getCurrentTab();
- tab.getWebView().requestFocus();
+ WebView w = tab.getWebView();
+ if (w != null) {
+ showTitleBarIndicator(w.getVisibleTitleHeight() == 0);
+ }
}
// webview scroll listener
@@ -266,7 +264,7 @@ public class TabBar extends LinearLayout
&& !isLoading()) {
if (visibleTitleHeight == 0) {
if (!showsTitleBarIndicator()) {
- mUi.hideFakeTitleBar();
+ mUi.hideTitleBar();
showTitleBarIndicator(true);
}
} else {
@@ -275,7 +273,6 @@ public class TabBar extends LinearLayout
}
}
}
- mVisibleTitleHeight = visibleTitleHeight;
}
@Override
@@ -588,7 +585,6 @@ public class TabBar extends LinearLayout
WebView webview = tab.getWebView();
if (webview != null) {
int h = webview.getVisibleTitleHeight();
- mVisibleTitleHeight = h -1;
onScroll(h);
}
}