Launcher

来源:互联网 发布:小绿人切换软件 编辑:程序博客网 时间:2024/05/16 00:59

一、在WorkSpace类中禁止窗口小部件长按事件

 void startDrag(CellLayout.CellInfo cellInfo) {
        View child = cellInfo.cell;
        
        ItemInfo itemInfo = (ItemInfo) child.getTag();
        if(itemInfo.toString().contains("AppWidget")){//添加判断
       
        }else if(itemInfo.toString().contains("ShortcutInfo")){//添加判断
       // Make sure the drag was started by a long press as opposed to a long click.
       if (!child.isInTouchMode()) {
           return;
       }

       mDragInfo = cellInfo;
       child.setVisibility(INVISIBLE);
       CellLayout layout = (CellLayout) child.getParent().getParent();
       layout.prepareChildForDrag(child);

       child.clearFocus();
       child.setPressed(false);

       final Canvas canvas = new Canvas();

       // The outline is used to visualize where the item will land if dropped
       mDragOutline = createDragOutline(child, canvas, DRAG_BITMAP_PADDING);
       beginDragShared(child, this);
        }
    }

二、在AppsCustomizePagedView类中去掉allApp中小部件页面

 private void updatePageCounts() {
        mNumWidgetPages = (int) Math.ceil(mWidgets.size() /
                (float) (mWidgetCountX * mWidgetCountY));
        mNumWidgetPages = 0;//把页面修改为0
        mNumAppsPages = (int) Math.ceil((float) mApps.size() / (mCellCountX * mCellCountY));
    }

三、http://www.cnblogs.com/mythou/p/3183081.html //Launcher修改的博客链接

四、PagedViewWithDraggableItems 中的onLongClick()方法中return true取消appIcon的长安监听

五、AppsCustomizeTabHost 中去掉allapp小title

protected void onFinishInflate() {

TextView tabView;
        String label;
        label = getContext().getString(R.string.all_apps_button_label);
        tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
        tabView.setText(label);
        tabView.setContentDescription(label);
        addTab(newTabSpec(APPS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
//        label = getContext().getString(R.string.widgets_tab_label);
//        tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
//        tabView.setText(label);
//        tabView.setContentDescription(label);
//        addTab(newTabSpec(WIDGETS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
        setOnTabChangedListener(this);


}

原创粉丝点击