Assign a field name for textfields in the browser.
Fix for http://b/issue?id=1605291. Store the url and name of the textfield in EditorInfo.fieldName.
This commit is contained in:
@@ -25,13 +25,14 @@ import android.text.Spannable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.MovementMethod;
|
||||
import android.util.Log;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.AbsoluteLayout.LayoutParams;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
@@ -269,6 +270,18 @@ import java.util.ArrayList;
|
||||
return ptr == mNodePointer;
|
||||
}
|
||||
|
||||
@Override public InputConnection onCreateInputConnection(
|
||||
EditorInfo outAttrs) {
|
||||
InputConnection connection = super.onCreateInputConnection(outAttrs);
|
||||
if (mWebView != null) {
|
||||
// Use the name of the textfield + the url. Use backslash as an
|
||||
// arbitrary separator.
|
||||
outAttrs.fieldName = mWebView.nativeFocusCandidateName() + "\\"
|
||||
+ mWebView.getUrl();
|
||||
}
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSelectionChanged(int selStart, int selEnd) {
|
||||
if (mWebView != null) {
|
||||
|
||||
@@ -5368,7 +5368,7 @@ public class WebView extends AbsoluteLayout
|
||||
private native boolean nativeFocusCandidateIsTextField();
|
||||
private native boolean nativeFocusCandidateIsTextInput();
|
||||
private native int nativeFocusCandidateMaxLength();
|
||||
private native String nativeFocusCandidateName();
|
||||
/* package */ native String nativeFocusCandidateName();
|
||||
private native Rect nativeFocusCandidateNodeBounds();
|
||||
/* package */ native int nativeFocusCandidatePointer();
|
||||
private native String nativeFocusCandidateText();
|
||||
|
||||
Reference in New Issue
Block a user