summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TabBar.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2010-12-13 18:12:46 -0800
committerMichael Kolb <kolby@google.com>2010-12-13 18:12:52 -0800
commit6a85e2ae52f5e7592731cfcf1b98639ea2a03b62 (patch)
treef107d37caadaacd98099f334f95f8ee46f5b3add /src/com/android/browser/TabBar.java
parentafdb794ba4a05716dfc52be7c4d3885fb4174d4a (diff)
downloadandroid_packages_apps_Gello-6a85e2ae52f5e7592731cfcf1b98639ea2a03b62.tar.gz
android_packages_apps_Gello-6a85e2ae52f5e7592731cfcf1b98639ea2a03b62.tar.bz2
android_packages_apps_Gello-6a85e2ae52f5e7592731cfcf1b98639ea2a03b62.zip
Fix url bar indicator
http://b/issue?id=3281700 Hide url bar indicator if tab is not active Change-Id: If87fa41a369e72d4b1cd790e9f2a800636bd5bc5
Diffstat (limited to 'src/com/android/browser/TabBar.java')
-rw-r--r--src/com/android/browser/TabBar.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java
index 79699559..ee3ea48e 100644
--- a/src/com/android/browser/TabBar.java
+++ b/src/com/android/browser/TabBar.java
@@ -25,7 +25,6 @@ import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
-import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Shader;
@@ -232,7 +231,7 @@ public class TabBar extends LinearLayout
public void onScroll(int visibleTitleHeight) {
// isLoading is using the current tab, which initially might not be set yet
if (mTabControl.getCurrentTab() != null) {
- if ((mVisibleTitleHeight > 0) && (visibleTitleHeight == 0)
+ if ((mVisibleTitleHeight != 0) && (visibleTitleHeight == 0)
&& !isLoading()) {
if (mUserRequestedUrlbar) {
mUi.hideFakeTitleBar();
@@ -320,7 +319,11 @@ public class TabBar extends LinearLayout
}
void showIndicator(boolean show) {
- mIndicator.setVisibility(show ? View.VISIBLE : View.GONE);
+ if (mSelected) {
+ mIndicator.setVisibility(show ? View.VISIBLE : View.GONE);
+ } else {
+ mIndicator.setVisibility(View.GONE);
+ }
}
@Override
@@ -356,6 +359,7 @@ public class TabBar extends LinearLayout
public void setActivated(boolean selected) {
mSelected = selected;
mClose.setVisibility(mSelected ? View.VISIBLE : View.GONE);
+ mIndicator.setVisibility(View.GONE);
mTitle.setTextAppearance(mActivity, mSelected ?
R.style.TabTitleSelected : R.style.TabTitleUnselected);
setHorizontalFadingEdgeEnabled(!mSelected);
@@ -508,7 +512,11 @@ public class TabBar extends LinearLayout
tvd.setProgress(tvd.mProgress);
// update the scroll state
WebView webview = tab.getWebView();
- onScroll(webview.getVisibleTitleHeight());
+ if (webview != null) {
+ int h = webview.getVisibleTitleHeight();
+ mVisibleTitleHeight = h -1;
+ onScroll(h);
+ }
}
}