Skip to content

Commit cf72ab4

Browse files
author
Amith Yamasani
committed
Don't show the submit button when it isn't enabled.
There was a particular scenario where it was being shown even if it's disabled. Bug: 5412759 Change-Id: I34edd385062bed48bccef35e8240932d4cc96fd1
1 parent 45a04db commit cf72ab4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/java/android/widget/SearchView.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,8 @@ private boolean isSubmitAreaEnabled() {
728728

729729
private void updateSubmitButton(boolean hasText) {
730730
int visibility = GONE;
731-
if (isSubmitAreaEnabled() && hasFocus() && (hasText || !mVoiceButtonEnabled)) {
731+
if (mSubmitButtonEnabled && isSubmitAreaEnabled() && hasFocus()
732+
&& (hasText || !mVoiceButtonEnabled)) {
732733
visibility = VISIBLE;
733734
}
734735
mSubmitButton.setVisibility(visibility);
@@ -1082,9 +1083,7 @@ private void onTextChanged(CharSequence newText) {
10821083
CharSequence text = mQueryTextView.getText();
10831084
mUserQuery = text;
10841085
boolean hasText = !TextUtils.isEmpty(text);
1085-
if (isSubmitButtonEnabled()) {
1086-
updateSubmitButton(hasText);
1087-
}
1086+
updateSubmitButton(hasText);
10881087
updateVoiceButton(!hasText);
10891088
updateCloseButton();
10901089
updateSubmitArea();

0 commit comments

Comments
 (0)