Loading core/java/android/webkit/WebTextView.java +22 −14 Original line number Diff line number Diff line Loading @@ -93,6 +93,28 @@ import java.util.ArrayList; // Treat ACTION_DOWN and ACTION MULTIPLE the same boolean down = event.getAction() != KeyEvent.ACTION_UP; int keyCode = event.getKeyCode(); boolean isArrowKey = false; switch(keyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: if (!mWebView.nativeCursorMatchesFocus()) { return down ? mWebView.onKeyDown(keyCode, event) : mWebView .onKeyUp(keyCode, event); } isArrowKey = true; break; } if (!isArrowKey && mWebView.nativeFocusNodePointer() != mNodePointer) { mWebView.nativeClearCursor(); remove(); return mWebView.dispatchKeyEvent(event); } Spannable text = (Spannable) getText(); int oldLength = text.length(); // Normally the delete key's dom events are sent via onTextChanged. Loading Loading @@ -133,20 +155,6 @@ import java.util.ArrayList; // Pass to super to handle longpress. return super.dispatchKeyEvent(event); } boolean isArrowKey = false; switch(keyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: if (!mWebView.nativeCursorMatchesFocus()) { return down ? mWebView.onKeyDown(keyCode, event) : mWebView .onKeyUp(keyCode, event); } isArrowKey = true; break; } // Ensure there is a layout so arrow keys are handled properly. if (getLayout() == null) { Loading core/java/android/webkit/WebView.java +3 −2 Original line number Diff line number Diff line Loading @@ -4904,8 +4904,8 @@ public class WebView extends AbsoluteLayout // sure the text edit box is still on the screen. if (inEditingMode() && nativeCursorIsTextInput()) { mWebTextView.bringIntoView(); } rebuildWebTextView(); } break; case CLEAR_TEXT_ENTRY: clearTextEntry(); Loading Loading @@ -5395,7 +5395,7 @@ public class WebView extends AbsoluteLayout nativeUpdateCachedTextfield(updatedText, mTextGeneration); } private native void nativeClearCursor(); /* package */ native void nativeClearCursor(); private native void nativeCreate(int ptr); private native int nativeCursorFramePointer(); private native Rect nativeCursorNodeBounds(); Loading Loading @@ -5432,6 +5432,7 @@ public class WebView extends AbsoluteLayout /* package */ native int nativeFocusCandidatePointer(); private native String nativeFocusCandidateText(); private native int nativeFocusCandidateTextSize(); /* package */ native int nativeFocusNodePointer(); private native Rect nativeGetCursorRingBounds(); private native Region nativeGetSelection(); private native boolean nativeHasCursorNode(); Loading Loading
core/java/android/webkit/WebTextView.java +22 −14 Original line number Diff line number Diff line Loading @@ -93,6 +93,28 @@ import java.util.ArrayList; // Treat ACTION_DOWN and ACTION MULTIPLE the same boolean down = event.getAction() != KeyEvent.ACTION_UP; int keyCode = event.getKeyCode(); boolean isArrowKey = false; switch(keyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: if (!mWebView.nativeCursorMatchesFocus()) { return down ? mWebView.onKeyDown(keyCode, event) : mWebView .onKeyUp(keyCode, event); } isArrowKey = true; break; } if (!isArrowKey && mWebView.nativeFocusNodePointer() != mNodePointer) { mWebView.nativeClearCursor(); remove(); return mWebView.dispatchKeyEvent(event); } Spannable text = (Spannable) getText(); int oldLength = text.length(); // Normally the delete key's dom events are sent via onTextChanged. Loading Loading @@ -133,20 +155,6 @@ import java.util.ArrayList; // Pass to super to handle longpress. return super.dispatchKeyEvent(event); } boolean isArrowKey = false; switch(keyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: if (!mWebView.nativeCursorMatchesFocus()) { return down ? mWebView.onKeyDown(keyCode, event) : mWebView .onKeyUp(keyCode, event); } isArrowKey = true; break; } // Ensure there is a layout so arrow keys are handled properly. if (getLayout() == null) { Loading
core/java/android/webkit/WebView.java +3 −2 Original line number Diff line number Diff line Loading @@ -4904,8 +4904,8 @@ public class WebView extends AbsoluteLayout // sure the text edit box is still on the screen. if (inEditingMode() && nativeCursorIsTextInput()) { mWebTextView.bringIntoView(); } rebuildWebTextView(); } break; case CLEAR_TEXT_ENTRY: clearTextEntry(); Loading Loading @@ -5395,7 +5395,7 @@ public class WebView extends AbsoluteLayout nativeUpdateCachedTextfield(updatedText, mTextGeneration); } private native void nativeClearCursor(); /* package */ native void nativeClearCursor(); private native void nativeCreate(int ptr); private native int nativeCursorFramePointer(); private native Rect nativeCursorNodeBounds(); Loading Loading @@ -5432,6 +5432,7 @@ public class WebView extends AbsoluteLayout /* package */ native int nativeFocusCandidatePointer(); private native String nativeFocusCandidateText(); private native int nativeFocusCandidateTextSize(); /* package */ native int nativeFocusNodePointer(); private native Rect nativeGetCursorRingBounds(); private native Region nativeGetSelection(); private native boolean nativeHasCursorNode(); Loading