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

Commit 8590ecd2 authored by Adam Cohen's avatar Adam Cohen Committed by Android (Google) Code Review
Browse files

Merge "Fix issue with adding widget with config activity to empty screen...

Merge "Fix issue with adding widget with config activity to empty screen (issue 11381059)" into jb-ub-now-jetsonic
parents 87752940 917e3885
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public class CellLayout extends ViewGroup {
    private int mHeightGap;
    private int mMaxGap;
    private boolean mScrollingTransformsDirty = false;
    private boolean mDropPending = false;

    private final Rect mRect = new Rect();
    private final CellInfo mCellInfo = new CellInfo();
@@ -332,6 +333,14 @@ public class CellLayout extends ViewGroup {
        mShortcutsAndWidgets.setInvertIfRtl(invert);
    }

    public void setDropPending(boolean pending) {
        mDropPending = pending;
    }

    public boolean isDropPending() {
        return mDropPending;
    }

    private void invalidateBubbleTextView(BubbleTextView icon) {
        final int padding = icon.getPressedOrFocusedBackgroundPadding();
        invalidate(icon.getLeft() + getPaddingLeft() - padding,
+4 −0
Original line number Diff line number Diff line
@@ -754,10 +754,14 @@ public class Launcher extends Activity
                };
            } else {
                result = resultCode;
                final CellLayout dropLayout =
                        (CellLayout) mWorkspace.getScreenWithId(mPendingAddInfo.screenId);
                dropLayout.setDropPending(true);
                onComplete = new Runnable() {
                    @Override
                    public void run() {
                        completeTwoStageWidgetDrop(result, appWidgetId);
                        dropLayout.setDropPending(false);
                    }
                };
            }
+2 −1
Original line number Diff line number Diff line
@@ -671,7 +671,8 @@ public class Workspace extends SmoothPagedView
        CellLayout finalScreen = mWorkspaceScreens.get(finalScreenId);

        // If the final screen is empty, convert it to the extra empty screen
        if (finalScreen.getShortcutsAndWidgets().getChildCount() == 0) {
        if (finalScreen.getShortcutsAndWidgets().getChildCount() == 0 &&
                !finalScreen.isDropPending()) {
            mWorkspaceScreens.remove(finalScreenId);
            mScreenOrder.remove(finalScreenId);