Merge "Removing usage of unsupportedApi AutoCompleteTextView.ensureImeVisible from SearchDialog Bug: 124452405 Test: No CTS test because SearchDialog is not exposed externally."
This commit is contained in:
committed by
Android (Google) Code Review
commit
5bbfa09a94
@@ -47,8 +47,10 @@ import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListPopupWindow;
|
||||
import android.widget.SearchView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -370,7 +372,10 @@ public class SearchDialog extends Dialog {
|
||||
updateSearchAppIcon();
|
||||
updateSearchBadge();
|
||||
if (isLandscapeMode(getContext())) {
|
||||
mSearchAutoComplete.ensureImeVisible(true);
|
||||
mSearchAutoComplete.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED);
|
||||
if (mSearchAutoComplete.isDropDownAlwaysVisible() || enoughToFilter()) {
|
||||
mSearchAutoComplete.showDropDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -381,6 +386,15 @@ public class SearchDialog extends Dialog {
|
||||
== Configuration.ORIENTATION_LANDSCAPE;
|
||||
}
|
||||
|
||||
private boolean enoughToFilter() {
|
||||
Filterable filterableAdapter = (Filterable) mSearchAutoComplete.getAdapter();
|
||||
if (filterableAdapter == null || filterableAdapter.getFilter() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return mSearchAutoComplete.enoughToFilter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the UI according to the info in the current value of {@link #mSearchable}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user