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.
This commit is contained in:
@@ -576,7 +576,14 @@ 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.
|
||||
*/
|
||||
|
||||
@@ -189,6 +189,8 @@ class SuggestionsAdapter extends ResourceCursorAdapter {
|
||||
if (DBG) Log.d(LOG_TAG, "notifyDataSetChanged");
|
||||
super.notifyDataSetChanged();
|
||||
|
||||
mSearchDialog.onDataSetChanged();
|
||||
|
||||
updateSpinnerState(getCursor());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user