From bcbf564a3f527266693233cacd6728770d1a65fd Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Wed, 17 Feb 2010 17:56:51 -0500 Subject: At the end of a zoom, only check if the textfield is onscreen. Previously, we checked to see if the IME was active on the WebTextView, in an attempt to fix http://b/issue?id=2266066 . If so, we move the textfield on screen. However, that is resulting in http://b/issue?id=2147168 , where a textfield far offscreen is being scrolled on screen at the end of a zoom, and with this change, the latter bug is fixed. Further, I am no longer able to reproduce the earlier bug with this change. --- core/java/android/webkit/WebView.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'core/java') diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 9672892..5f5df56 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3088,14 +3088,11 @@ public class WebView extends AbsoluteLayout Rect vBox = contentToViewRect(contentBounds); Rect visibleRect = new Rect(); calcOurVisibleRect(visibleRect); - // The IME may have shown, resulting in the textfield being offscreen. - // If so, the textfield will be scrolled on screen, so treat it as - // though it is on screen. If it is on screen, place the WebTextView in - // its new place, accounting for our new scroll/zoom values. - InputMethodManager imm = InputMethodManager.peekInstance(); - if ((imm != null && imm.isActive(mWebTextView)) - || (allowIntersect ? Rect.intersects(visibleRect, vBox) - : visibleRect.contains(vBox))) { + // If the textfield is on screen, place the WebTextView in + // its new place, accounting for our new scroll/zoom values, + // and adjust its textsize. + if (allowIntersect ? Rect.intersects(visibleRect, vBox) + : visibleRect.contains(vBox)) { mWebTextView.setRect(vBox.left, vBox.top, vBox.width(), vBox.height()); mWebTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, -- cgit v1.1