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

Commit b059d906 authored by Mike LeBeau's avatar Mike LeBeau
Browse files

Make in-app search have a different background resource which looks

like a slide-out drawer, to provide app context and because it is not
full-screen.

Also fix a problem where bringing up global search sometimes still did
not size the dropdown correctly, because the keyboard was not yet showing.
parent ed3b804f
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -325,6 +325,14 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
        
        // show the dialog. this will call onStart().
        if (!isShowing()) {
            // First make sure the keyboard is showing (if needed), so that we get the right height
            // for the dropdown to respect the IME.
            if (getContext().getResources().getConfiguration().hardKeyboardHidden ==
                Configuration.HARDKEYBOARDHIDDEN_YES) {
                InputMethodManager inputManager = (InputMethodManager)
                getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                        inputManager.showSoftInputUnchecked(0, null);
            }
            show();
        }

@@ -528,13 +536,16 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
        mSearchAutoComplete.setDropDownAnimationStyle(0); // no animation
        mSearchAutoComplete.setThreshold(mSearchable.getSuggestThreshold());

        // TODO: Use different dropdown background resource for in-app search.
        if (mGlobalSearchMode) {
            mSearchAutoComplete.setDropDownAlwaysVisible(true);  // fill space until results come in
            mSearchAutoComplete.setDropDownDismissedOnCompletion(false);
            mSearchAutoComplete.setDropDownBackgroundResource(
                    com.android.internal.R.drawable.search_dropdown_background);
        } else {
            mSearchAutoComplete.setDropDownAlwaysVisible(false);
            mSearchAutoComplete.setDropDownDismissedOnCompletion(true);
            mSearchAutoComplete.setDropDownBackgroundResource(
                    com.android.internal.R.drawable.search_dropdown_background_apps);
        }

        // attach the suggestions adapter, if suggestions are available
+412 B
Loading image diff...