diff options
-rw-r--r-- | src/com/android/browser/BaseUi.java | 20 | ||||
-rw-r--r-- | src/com/android/browser/TitleBarBase.java | 26 | ||||
-rw-r--r-- | src/com/android/browser/TitleBarXLarge.java | 13 | ||||
-rw-r--r-- | src/com/android/browser/UrlInputView.java | 9 |
4 files changed, 22 insertions, 46 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index 71346ae..4f80e9d 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -17,10 +17,7 @@ package com.android.browser; import com.android.browser.Tab.LockIcon; -import com.android.browser.UI.DropdownChangeListener; -import android.animation.Animator; -import android.animation.Animator.AnimatorListener; import android.animation.ObjectAnimator; import android.app.Activity; import android.content.res.Configuration; @@ -421,10 +418,10 @@ public abstract class BaseUi implements UI, WebViewFactory { protected abstract TitleBarBase getTitleBar(); protected void setTitleGravity(int gravity) { - getTitleBar().setTitleGravity(gravity); - Tab tab = getActiveTab(); - if ((tab != null) && (tab.getWebView() != null)) { - tab.getWebView().setTitleBarGravity(gravity); + WebView web = getWebView(); + if (web != null) { + web.setTitleBarGravity(gravity); + web.invalidate(); } } @@ -724,4 +721,13 @@ public abstract class BaseUi implements UI, WebViewFactory { @Override public void registerDropdownChangeListener(DropdownChangeListener d) { } + + protected WebView getWebView() { + Tab tab = getActiveTab(); + if (tab != null) { + return tab.getWebView(); + } + return null; + } + } diff --git a/src/com/android/browser/TitleBarBase.java b/src/com/android/browser/TitleBarBase.java index 601d35f..b905d4e 100644 --- a/src/com/android/browser/TitleBarBase.java +++ b/src/com/android/browser/TitleBarBase.java @@ -29,9 +29,7 @@ import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.PaintDrawable; import android.os.Bundle; import android.speech.RecognizerResultsIntent; -import android.view.Gravity; import android.view.View; -import android.widget.AbsoluteLayout; import android.widget.ImageView; import android.widget.LinearLayout; @@ -94,30 +92,6 @@ public class TitleBarBase extends LinearLayout implements UrlInputListener { /* package */ void setIncognitoMode(boolean incognito) {} - void setTitleGravity(int gravity) { - int newTop = 0; - int newLeft = 0; - View parent = (View) getParent(); - if (parent != null) { - newLeft = parent.getScrollX(); - } - if (gravity != Gravity.NO_GRAVITY) { - if (parent != null) { - if (gravity == Gravity.TOP) { - newTop = parent.getScrollY(); - } else if (gravity == Gravity.BOTTOM) { - newTop = parent.getScrollY() + parent.getHeight() - getHeight(); - } - } - } - AbsoluteLayout.LayoutParams lp = (AbsoluteLayout.LayoutParams) getLayoutParams(); - if (lp != null) { - lp.x = newLeft; - lp.y = newTop; - setLayoutParams(lp); - } - } - public int getEmbeddedHeight() { return getHeight(); } diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java index 5f02002..9fcc7b7 100644 --- a/src/com/android/browser/TitleBarXLarge.java +++ b/src/com/android/browser/TitleBarXLarge.java @@ -20,7 +20,6 @@ import com.android.browser.UI.DropdownChangeListener; import com.android.browser.autocomplete.SuggestedTextController.TextChangeWatcher; import com.android.browser.search.SearchEngine; -import android.accounts.Account; import android.app.Activity; import android.content.Context; import android.content.res.Resources; @@ -105,18 +104,6 @@ public class TitleBarXLarge extends TitleBarBase initLayout(activity); } - @Override - void setTitleGravity(int gravity) { - if (mUseQuickControls) { - FrameLayout.LayoutParams lp = - (FrameLayout.LayoutParams) getLayoutParams(); - lp.gravity = gravity; - setLayoutParams(lp); - } else { - super.setTitleGravity(gravity); - } - } - private void initLayout(Context context) { LayoutInflater factory = LayoutInflater.from(context); factory.inflate(R.layout.url_bar, this); diff --git a/src/com/android/browser/UrlInputView.java b/src/com/android/browser/UrlInputView.java index 350d772..9c5d338 100644 --- a/src/com/android/browser/UrlInputView.java +++ b/src/com/android/browser/UrlInputView.java @@ -296,4 +296,13 @@ public class UrlInputView extends SuggestiveAutoCompleteTextView void registerDropdownChangeListener(DropdownChangeListener d) { mDropdownListener = d; } + + /* + * no-op to prevent scrolling of webview when embedded titlebar is edited + */ + @Override + public boolean requestRectangleOnScreen(Rect rect, boolean immediate) { + return false; + } + } |