(7)Launcher3客制化之,修改單螢幕後,Fix在Hotseat拖動應用刪除報錯,launcher3hotseat

來源:互聯網
上載者:User

(7)Launcher3客制化之,修改單螢幕後,Fix在Hotseat拖動應用刪除報錯,launcher3hotseat

修改單螢幕後,在workspace裡面拖動表徵圖,到刪除按鈕上鬆開的時候,報錯問題。

並且無法再次顯示拖動的表徵圖。

拖動鬆開手時候觸發

public void onDropCompleted(final View target, final DragObject d,            final boolean isFlingToDelete, final boolean success) {        if (mDeferDropAfterUninstall) {//如果要卸載軟體重新調用一次            mDeferredAction = new Runnable() {                    public void run() {                        onDropCompleted(target, d, isFlingToDelete, success);                        mDeferredAction = null;                    }                };            return;        }        boolean beingCalledAfterUninstall = mDeferredAction != null;        if (success && !(beingCalledAfterUninstall && !mUninstallSuccessful)) {            if (target != this && mDragInfo != null) {                CellLayout parentCell = getParentCellLayoutForView(mDragInfo.cell);                if (parentCell != null) {                    parentCell.removeView(mDragInfo.cell);                }                if (mDragInfo.cell instanceof DropTarget) {                    mDragController.removeDropTarget((DropTarget) mDragInfo.cell);                }                // If we move the item to anything not on the Workspace, check if any empty                // screens need to be removed. If we dropped back on the workspace, this will                // be done post drop animation.                stripEmptyScreens();            }        } else if (mDragInfo != null && target != null && (!(target instanceof InfoDropTarget))) {            CellLayout cellLayout;            if (mLauncher.isHotseatLayout(target)) {                cellLayout = mLauncher.getHotseat().getLayout();            } else {                cellLayout = getScreenWithId(mDragInfo.screenId);            }            //            if (cellLayout == null) {//                throw new RuntimeException("Invalid state: cellLayout == null in "//                        + "Workspace#onDropCompleted. Please file a bug. ");//            }            在此處加入這兩句即可修複此BUG            if (cellLayout != null) {                cellLayout.onDropChild(mDragInfo.cell);            }                        if( mDragInfo.cell!=null){            <span style="white-space:pre"></span>  mDragInfo.cell.setVisibility(VISIBLE);            }        }        if ((d.cancelled || target instanceof InfoDropTarget || (beingCalledAfterUninstall && !mUninstallSuccessful))                && mDragInfo.cell != null) {            mDragInfo.cell.setVisibility(VISIBLE);        }                       mDragOutline = null;        mDragInfo = null;       }




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.