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

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

Show AutoCompleteTextView dropdown in Search dialog when cursor updates. Fixes b/2426929

Calls onFilterComplete when the data set changes, so that it can recompute whether
the dropdown should be shown or not.
parent c37cb246
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -577,6 +577,13 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
        mVoiceButton.setVisibility(visibility);
    }

    /** Called by SuggestionsAdapter when the cursor contents changed. */
    void onDataSetChanged() {
        if (mSearchAutoComplete != null && mSuggestionsAdapter != null) {
            mSearchAutoComplete.onFilterComplete(mSuggestionsAdapter.getCount());
        }
    }

    /**
     * Hack to determine whether this is the browser, so we can adjust the UI.
     */
+2 −0
Original line number Diff line number Diff line
@@ -189,6 +189,8 @@ class SuggestionsAdapter extends ResourceCursorAdapter {
        if (DBG) Log.d(LOG_TAG, "notifyDataSetChanged");
        super.notifyDataSetChanged();

        mSearchDialog.onDataSetChanged();

        updateSpinnerState(getCursor());
    }