Skip to content

Commit 68b9074

Browse files
jreckAndroid (Google) Code Review
authored andcommitted
Merge "Prevent adapter flickering"
2 parents 526c226 + a607060 commit 68b9074

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

core/java/android/webkit/WebTextView.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,10 @@ private void setMaxLength(int maxLength) {
896896
* WebTextView represents.
897897
*/
898898
/* package */ void setNodePointer(int ptr) {
899-
mNodePointer = ptr;
899+
if (ptr != mNodePointer) {
900+
mNodePointer = ptr;
901+
setAdapterCustom(null);
902+
}
900903
}
901904

902905
/**
@@ -1051,11 +1054,12 @@ private void setMaxLength(int maxLength) {
10511054
}
10521055
setHint(null);
10531056
setThreshold(1);
1057+
boolean autoComplete = false;
10541058
if (single) {
10551059
mWebView.requestLabel(mWebView.nativeFocusCandidateFramePointer(),
10561060
mNodePointer);
10571061
maxLength = mWebView.nativeFocusCandidateMaxLength();
1058-
boolean autoComplete = mWebView.nativeFocusCandidateIsAutoComplete();
1062+
autoComplete = mWebView.nativeFocusCandidateIsAutoComplete();
10591063
if (type != PASSWORD && (mAutoFillable || autoComplete)) {
10601064
String name = mWebView.nativeFocusCandidateName();
10611065
if (name != null && name.length() > 0) {
@@ -1070,8 +1074,9 @@ private void setMaxLength(int maxLength) {
10701074
setInputType(inputType);
10711075
setImeOptions(imeOptions);
10721076
setVisibility(VISIBLE);
1073-
AutoCompleteAdapter adapter = null;
1074-
setAdapterCustom(adapter);
1077+
if (!autoComplete) {
1078+
setAdapterCustom(null);
1079+
}
10751080
}
10761081

10771082
/**

core/java/android/webkit/WebView.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3246,8 +3246,7 @@ public void clearCache(boolean includeDiskFiles) {
32463246
public void clearFormData() {
32473247
checkThread();
32483248
if (inEditingMode()) {
3249-
AutoCompleteAdapter adapter = null;
3250-
mWebTextView.setAdapterCustom(adapter);
3249+
mWebTextView.setAdapterCustom(null);
32513250
}
32523251
}
32533252

0 commit comments

Comments
 (0)