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:
Amith Yamasani
2010-03-04 14:29:54 -08:00
parent c37cb24695
commit defb1df520
2 changed files with 10 additions and 1 deletions

View File

@@ -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.
*/

View File

@@ -189,6 +189,8 @@ class SuggestionsAdapter extends ResourceCursorAdapter {
if (DBG) Log.d(LOG_TAG, "notifyDataSetChanged");
super.notifyDataSetChanged();
mSearchDialog.onDataSetChanged();
updateSpinnerState(getCursor());
}