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

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

Merge commit '4182e684' into manualmerge

Conflicts:
	core/java/android/widget/AutoCompleteTextView.java
parents f57117b7 4182e684
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -541,6 +541,8 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
            mSearchAutoComplete.setDropDownAlwaysVisible(false);
        }

        mSearchAutoComplete.setForceIgnoreOutsideTouch(true);

        // attach the suggestions adapter, if suggestions are available
        // The existence of a suggestions authority is the proxy for "suggestions available here"
        if (mSearchable.getSuggestAuthority() != null) {
+19 −1
Original line number Diff line number Diff line
@@ -117,6 +117,8 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe

    private boolean mDropDownDismissedOnCompletion = true;
    
    private boolean mForceIgnoreOutsideTouch = false;

    private int mLastKeyCode = KeyEvent.KEYCODE_UNKNOWN;
    private boolean mOpenBefore;

@@ -1128,6 +1130,8 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
                heightSpec = mDropDownHeight;
            }

            mPopup.setOutsideTouchable(mForceIgnoreOutsideTouch ? false : !mDropDownAlwaysVisible);

            mPopup.update(getDropDownAnchorView(), mDropDownHorizontalOffset,
                    mDropDownVerticalOffset, widthSpec, heightSpec);
        } else {
@@ -1153,7 +1157,10 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe

            mPopup.setWindowLayoutMode(widthSpec, heightSpec);
            mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
            mPopup.setOutsideTouchable(true);
            
            // use outside touchable to dismiss drop down when touching outside of it, so
            // only set this if the dropdown is not always visible
            mPopup.setOutsideTouchable(mForceIgnoreOutsideTouch ? false : !mDropDownAlwaysVisible);
            mPopup.setTouchInterceptor(new PopupTouchIntercepter());
            mPopup.showAsDropDown(getDropDownAnchorView(),
                    mDropDownHorizontalOffset, mDropDownVerticalOffset);
@@ -1163,6 +1170,17 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
        }
    }
    
    /**
     * Forces outside touches to be ignored. Normally if {@link #isDropDownAlwaysVisible()} is
     * false, we allow outside touch to dismiss the dropdown. If this is set to true, then we
     * ignore outside touch even when the drop down is not set to always visible.
     * 
     * @hide used only by SearchDialog
     */
    public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
        mForceIgnoreOutsideTouch = forceIgnoreOutsideTouch;
    }

    /**
     * <p>Builds the popup window's content and returns the height the popup
     * should have. Returns -1 when the content already exists.</p>