Launcher hotseat上icon显示文字的修改

Hotseat显示文字

 

Launcher hotseat上icon显示文字的修改_第1张图片 

原生launcher对hotseat上的图标做了不显示文字的处理

 

1.       显示文字修改如下

往hotseat上添加图标(workspace.java的addInscreen()方法中)相关代码做如下修改:

 

           

if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {

 

            //对处于hotseat上的图标进行缩小处理

child.setScaleX(0.8f);

            child.setScaleY(0.8f);

 

           .…..

//如果Icon处于hotseat上则关闭文字的边缘渲染,以减少GPU的负担

//Hotseat Icon Text Label is not visible anyway and drawing theFadingEdge for the

           //Text label takes a heavy toll on GPU during hw accelerated rendering

           //So disable FadingEdge for text Label if the Icon is in Hotseat

 

           //if (child instanceof TextView) {

                TextView hotseatIcon =(TextView)child;

                //if(hotseatIcon.isHorizontalFadingEdgeEnabled()){

                   //hotseatIcon.setHorizontalFadingEdgeEnabled(false);

                //}

            //}

 

           //如果文件夹处于hotseat上则不显示文字

           // Hide folder title in the hotseat

           //if (child instanceof FolderIcon) {

                //((FolderIcon)child).setTextVisible(false);

            //}

……

} else {

        //还原

                child.setScaleX(1);

                 child.setScaleY(1);

            ……..

}

 

 

2.在CellLayout的addViewToCellLayout()方法中修改如下

//如果icon处于hotseat上则将字体颜色设为透明

 

// Hotseat icons - remove text

       ……

           //if(mIsHotseat) {

            //    bubbleChild.setTextColor(res.getColor(android.R.color.transparent));

            //} else {

            //    bubbleChild.setTextColor(res.getColor(R.color.workspace_icon_text_color));

            //}

            bubbleChild.setTextColor(res.getColor(R.color.workspace_icon_text_color));

 

       }

 

3. 调整hotseat上的单元格高度,使得有空间来显示文字

//调整hotseat高度

78dp

//调整单元格高度

78dp

 

你可能感兴趣的:(hotseat显示文字)