需求:Launcher 最基本的修改就是Workspace Hotseat AllApps的布局及出厂默认设置
修改原理:
res/xml/device_profiles.xml 图标的横竖排数量、图标大小、各种尺寸和间距主要是由device_profiles.xml这个配置文件来定义的。
DeviceProfile.java device_profiles.xml是由DeviceProfile.java来加载并计算得到布局所需要的各种size padding 等参数。
res/xml/default_workspace_6x3.xml 定义了系统默认(出厂设置)的桌面内容
Hotseat.java Hotseat ViewGroup的代码实现
修改步骤:
step1: 需要根据预览图来定义好放在Workpace/AllApps/Hotseat里的图标数量。
操作提示: 重名6_by_3,代表6行3列,复制并改名一份default_workspace_6x3.xml
<grid-option
launcher:name="6_by_3"
launcher:numRows="3" //行数
launcher:numColumns="6" //列数
launcher:numSearchContainerColumns="3"
launcher:numFolderRows="3" //文件夹行数
launcher:numFolderColumns="3"//文件夹列数
launcher:numHotseatIcons="5"//热座图标数量
launcher:hotseatColumnSpanLandscape="1"
launcher:numAllAppsColumns="6"//AllApps视图的列数
launcher:isScalable="true"
launcher:devicePaddingId="@xml/p