Skip to content

Commit 7919bfb

Browse files
Amith YamasaniAndroid (Google) Code Review
authored andcommitted
Merge "Don't show the submit button when it isn't enabled." into ics-mr1
2 parents 19c86ca + cf72ab4 commit 7919bfb

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)