Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b47c4fd2 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Don't call onQueryTextChanged more often than necessary.

Also update the hint text if iconifiedByDefault changes.

Bug: 5097238
Change-Id: I876b3f3e74c30230f68d6bc88a95e182e4cc652b
parent 01704e76
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
    private boolean mClearingFocus;
    private int mMaxWidth;
    private boolean mVoiceButtonEnabled;
    private CharSequence mOldQueryText;
    private CharSequence mUserQuery;
    private boolean mExpandedInActionView;

@@ -462,6 +463,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        if (mIconifiedByDefault == iconified) return;
        mIconifiedByDefault = iconified;
        updateViewsVisibility(iconified);
        updateQueryHint();
    }

    /**
@@ -970,9 +972,10 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        updateVoiceButton(!hasText);
        updateCloseButton();
        updateSubmitArea();
        if (mOnQueryChangeListener != null) {
        if (mOnQueryChangeListener != null && !TextUtils.equals(newText, mOldQueryText)) {
            mOnQueryChangeListener.onQueryTextChange(newText.toString());
        }
        mOldQueryText = newText.toString();
    }

    private void onSubmitQuery() {