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

Commit d7f0ead7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Dismissing popup if the underlying icon no longer supports it" into ub-launcher3-master

parents 06849da4 1818fb7a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2497,6 +2497,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
    @Override
    public void bindAllApplications(AppInfo[] apps, int flags) {
        mAppsView.getAppsStore().setApps(apps, flags);
        PopupContainerWithArrow.dismissInvalidPopup(this);
    }

    /**
@@ -2528,6 +2529,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
    public void bindWorkspaceItemsChanged(List<WorkspaceItemInfo> updated) {
        if (!updated.isEmpty()) {
            mWorkspace.updateShortcuts(updated);
            PopupContainerWithArrow.dismissInvalidPopup(this);
        }
    }

@@ -2552,6 +2554,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
    public void bindWorkspaceComponentsRemoved(final ItemInfoMatcher matcher) {
        mWorkspace.removeItemsByMatcher(matcher);
        mDragController.onAppsRemoved(matcher);
        PopupContainerWithArrow.dismissInvalidPopup(this);
    }

    @Override
+11 −0
Original line number Diff line number Diff line
@@ -599,6 +599,17 @@ public class PopupContainerWithArrow<T extends BaseDraggingActivity> extends Arr
        }
    }

    /**
     * Dismisses the popup if it is no longer valid
     */
    public static void dismissInvalidPopup(BaseDraggingActivity activity) {
        PopupContainerWithArrow popup = getOpen(activity);
        if (popup != null && (!popup.mOriginalIcon.isAttachedToWindow()
                || !canShow(popup.mOriginalIcon, (ItemInfo) popup.mOriginalIcon.getTag()))) {
            popup.animateClose();
        }
    }

    /**
     * Handler to control drag-and-drop for popup items
     */
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.model.data.PromiseAppInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.IntArray;
@@ -296,6 +297,7 @@ public class SecondaryDisplayLauncher extends BaseDraggingActivity
    @Override
    public void bindAllApplications(AppInfo[] apps, int flags) {
        mAppsView.getAppsStore().setApps(apps, flags);
        PopupContainerWithArrow.dismissInvalidPopup(this);
    }

    public PopupDataProvider getPopupDataProvider() {