Make the search dialog's autocomplete dropdown behave correctly
with respect to the soft keyboard. getMaxAvailableHeight in PopupWindow relies on View's getWindowVisibleDisplayFrame, which always takes into account the IME, whereas in this case, because we want the window to extend down to the bottom of the display when it is being interacted with by the user, I added a new boolean option 'ignoreBottomDecorations' to getMaxAvailableHeight. If true, the method returns the height which will extend the PopupWindow down to the bottom of the screen, rather than just down to the IME. Then in AutoCompleteTextView, I set this to true when the dropDownAlwaysVisible attribute is true and the PopupWindow's input method mode is INPUT_METHOD_NOT_NEEDED (which happens when the list is dragged or otherwise interacted with). Then, because the dropdown height is only calculated when we call showDropDown(), I had to replace a couple calls to mPopup.update(). There are still a few remaining bugs here I'm tracking Still to do: * Fix a strange re-placement of the window which happens intermittently. * Strange behavior when using the directional pad. * In a few cases, the list does not correctly size itself to the IME. This seems to be because the available height is calculated before the IME is yet on screen, and thus is calculated as the entire screen.
Loading
Please register or sign in to comment