summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/WebTextView.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-07-01 10:57:47 -0400
committerLeon Scroggins <scroggo@google.com>2009-07-01 10:57:47 -0400
commit409812691def88027dc16ac930646eb260536c69 (patch)
tree876601fcab9f707624547d1850491964778710a3 /core/java/android/webkit/WebTextView.java
parent3ccd3655a09633794f4d815ff85f35fa986a10d4 (diff)
Fixes for moving a focused textfield on screen when entering a character.
When the focused node is a textfield, but the WebView has focus (for example if the page had an initial focus) and the cursor is not over a plugin or textfield, rebuild the WebTextView to handle the keys. Also, remove mScrollToAccommodateCursor, since now the WebTextView is only showing when we want to scroll.
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
-rw-r--r--core/java/android/webkit/WebTextView.java26
1 files changed, 0 insertions, 26 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index d1904b7be1c8..25a20f2e2221 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -17,7 +17,6 @@
package android.webkit;
import android.content.Context;
-import android.graphics.Rect;
import android.text.Editable;
import android.text.InputFilter;
import android.text.Selection;
@@ -58,9 +57,6 @@ import java.util.ArrayList;
// on the enter key. The method for blocking unmatched key ups prevents
// the shift key from working properly.
private boolean mGotEnterDown;
- // mScrollToAccommodateCursor being set to false prevents us from scrolling
- // the cursor on screen when using the trackball to select a textfield.
- private boolean mScrollToAccommodateCursor;
private int mMaxLength;
// Keep track of the text before the change so we know whether we actually
// need to send down the DOM events.
@@ -189,7 +185,6 @@ import java.util.ArrayList;
if (maxedOut && !isArrowKey && keyCode != KeyEvent.KEYCODE_DEL) {
if (oldEnd == oldStart) {
// Return true so the key gets dropped.
- mScrollToAccommodateCursor = true;
return true;
} else if (!oldText.equals(getText().toString())) {
// FIXME: This makes the text work properly, but it
@@ -203,7 +198,6 @@ import java.util.ArrayList;
int newEnd = Selection.getSelectionEnd(span);
mWebView.replaceTextfieldText(0, oldLength, span.toString(),
newStart, newEnd);
- mScrollToAccommodateCursor = true;
return true;
}
}
@@ -219,7 +213,6 @@ import java.util.ArrayList;
sendDomEvent(event);
}
*/
- mScrollToAccommodateCursor = true;
return true;
}
// Ignore the key up event for newlines. This prevents
@@ -373,12 +366,6 @@ import java.util.ArrayList;
// Selection is changed in onSelectionChanged
return true;
}
- // If the user is in a textfield, and the movement method is not
- // handling the trackball events, it means they are at the end of the
- // field and continuing to move the trackball. In this case, we should
- // not scroll the cursor on screen bc the user may be attempting to
- // scroll the page, possibly in the opposite direction of the cursor.
- mScrollToAccommodateCursor = false;
return false;
}
@@ -392,11 +379,6 @@ import java.util.ArrayList;
getWindowToken(), 0);
mWebView.removeView(this);
mWebView.requestFocus();
- mScrollToAccommodateCursor = false;
- }
-
- /* package */ void enableScrollOnScreen(boolean enable) {
- mScrollToAccommodateCursor = enable;
}
/* package */ void bringIntoView() {
@@ -405,14 +387,6 @@ import java.util.ArrayList;
}
}
- @Override
- public boolean requestRectangleOnScreen(Rect rectangle) {
- if (mScrollToAccommodateCursor) {
- return super.requestRectangleOnScreen(rectangle);
- }
- return false;
- }
-
/**
* Send the DOM events for the specified event.
* @param event KeyEvent to be translated into a DOM event.