summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BrowserWebView.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-08-12 11:08:30 -0700
committerJohn Reck <jreck@google.com>2011-08-12 11:08:59 -0700
commit718a24d6c9671fe2da4112a3b5f30fd3939b38e8 (patch)
tree41a6e829625f0e47dda2b65a455adf15c1e36339 /src/com/android/browser/BrowserWebView.java
parent58891907e3cf77b72f1107ef5d9f4c984cb176ed (diff)
downloadpackages_apps_browser-718a24d6c9671fe2da4112a3b5f30fd3939b38e8.zip
packages_apps_browser-718a24d6c9671fe2da4112a3b5f30fd3939b38e8.tar.gz
packages_apps_browser-718a24d6c9671fe2da4112a3b5f30fd3939b38e8.tar.bz2
URL Bar auto show tweaks
Bug: 5144824 Bug: 5142398 Change-Id: I235828d52bc8d8c35e2b625d767caeffb2d9b654
Diffstat (limited to 'src/com/android/browser/BrowserWebView.java')
-rw-r--r--src/com/android/browser/BrowserWebView.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/com/android/browser/BrowserWebView.java b/src/com/android/browser/BrowserWebView.java
index dd93c1f..2042ccf 100644
--- a/src/com/android/browser/BrowserWebView.java
+++ b/src/com/android/browser/BrowserWebView.java
@@ -29,8 +29,13 @@ import java.util.Map;
*/
public class BrowserWebView extends WebView {
+ public interface OnScrollChangedListener {
+ void onScrollChanged(int l, int t, int oldl, int oldt);
+ }
+
private boolean mBackgroundRemoved = false;
private TitleBar mTitleBar;
+ private OnScrollChangedListener mOnScrollChangedListener;
/**
* @param context
@@ -88,7 +93,7 @@ public class BrowserWebView extends WebView {
}
@Override
- protected void onDraw(android.graphics.Canvas c) {
+ protected void onDraw(Canvas c) {
super.onDraw(c);
if (!mBackgroundRemoved && getRootView().getBackground() != null) {
mBackgroundRemoved = true;
@@ -104,4 +109,16 @@ public class BrowserWebView extends WebView {
onDraw(c);
}
+ @Override
+ protected void onScrollChanged(int l, int t, int oldl, int oldt) {
+ super.onScrollChanged(l, t, oldl, oldt);
+ if (mOnScrollChangedListener != null) {
+ mOnScrollChangedListener.onScrollChanged(l, t, oldl, oldt);
+ }
+ }
+
+ public void setOnScrollChangedListener(OnScrollChangedListener listener) {
+ mOnScrollChangedListener = listener;
+ }
+
}