zoukankan      html  css  js  c++  java
  • (7)Launcher3客制化之,改动单屏幕后,Fix在Hotseat拖动应用删除报错

    改动单屏幕后,在workspace里面拖动图标。到删除button上松开的时候,报错问题。

    而且无法再次显示拖动的图标。

    拖动松开手时候触发

    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;
       
        }
    
    
       
    
  • 相关阅读:
    配置VRRP主备功能
    网络拓扑实例02:MSTP功能
    网络拓扑实例01:RSTP功能
    配置PoE交换机功能
    交换机基于接口划分VLAN(汇聚层设备作为网关)
    交换机基于接口划分VLAN(接入层设备作为网关)
    配置交换机Trunk接口流量本地优先转发(集群/堆叠)
    配置交换机之间直连链路聚合-LACP模式
    配置交换机之间直连链路聚合-手工模式
    配置交换机接口二三层切换
  • 原文地址:https://www.cnblogs.com/zhchoutai/p/7119834.html
Copyright © 2011-2022 走看看