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

Commit 174231d8 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 3879 into donut

* changes:
  ACTV: getWindowVisibility() instead of private attach count
parents db8a6ae6 50145bc8
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -123,10 +123,6 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe

    private AutoCompleteTextView.ListSelectorHider mHideSelector;

    // Indicates whether this AutoCompleteTextView is attached to a window or not
    // The widget is attached to a window when mAttachCount > 0
    private int mAttachCount;

    private AutoCompleteTextView.PassThroughClickListener mPassThroughClickListener;

    public AutoCompleteTextView(Context context) {
@@ -960,7 +956,8 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe

    /** {@inheritDoc} */
    public void onFilterComplete(int count) {
        if (mAttachCount <= 0) return;
        // Not attached to window, don't update drop-down
        if (getWindowVisibility() == View.GONE) return;

        /*
         * This checks enoughToFilter() again because filtering requests
@@ -999,13 +996,11 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        mAttachCount++;
    }

    @Override
    protected void onDetachedFromWindow() {
        dismissDropDown();
        mAttachCount--;
        super.onDetachedFromWindow();
    }