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

Commit 748ee2e8 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

ActivityChooser view not handling its removal and relayout properly.

1. ActivityChooserView did not hide the popup window when detached.

bug:6544220

2. ActivityChooserView was calling show popup when it was already
   showing it resulting in an incrrect update and losing one item
   per rotation.

bug:6522041

Change-Id: Iec1682ca5d27e38caf57214fa86060edf82a2166
parent 53d003f0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -400,6 +400,9 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
        if (viewTreeObserver.isAlive()) {
            viewTreeObserver.removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
        }
        if (isShowingPopup()) {
            dismissPopup();
        }
        mIsAttachedToWindow = false;
    }

@@ -420,9 +423,7 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        mActivityChooserContent.layout(0, 0, right - left, bottom - top);
        if (getListPopupWindow().isShowing()) {
            showPopupUnchecked(mAdapter.getMaxActivityCount());
        } else {
        if (!isShowingPopup()) {
            dismissPopup();
        }
    }