1. 修改Launcher中显示的预置app
default_workspace.xml
<favorite launcher:packageName="com.tecom.welly.myandroid" launcher:className="com.tecom.welly.myandroid.MainFrame" launcher:screen="1" launcher:x="3" launcher:y="3" />
packageName:包名 className :在桌面上显示的activity screen : 在哪一个screen添加 x,y: 在screen中的位置
2. 修改屏幕数目】
(1)Launcher.java
static final int SCREEN_COUNT = 7;
static final int DEFAULT_SCREEN = 4;
(2)Laucher.xml
<com.android.launcher2.Workspace
android:id="@+id/workspace"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="horizontal"
android:fadeScrollbars="true"
launcher:defaultScreen="4">
<include android:id="@+id/cell1" layout="@layout/workspace_screen" />
<include android:id="@+id/cell2" layout="@layout/workspace_screen" />
<include android:id="@+id/cell3" layout="@layout/workspace_screen" />
<include android:id="@+id/cell4" layout="@layout/workspace_screen" />
<include android:id="@+id/cell5" layout="@layout/workspace_screen" />
<include android:id="@+id/cell6" layout="@layout/workspace_screen" />
<include android:id="@+id/cell7" layout="@layout/workspace_screen" />
3. 在Launcher桌面添加widget
5. 设置墙纸
替换图片
frameworks/base/core/res/res/drawable/default_wallpaper.jpg
mm
make snod
6. 修改快捷方式的大小
7. 修改桌面的行列
(1)修改行列
Android_src/packages/apps/Launcher/res/layout-port/workspace_screen.xml
launcher:shortAxisCells="4" launcher:longAxisCells="4"
行 列
改为:
launcher:shortAxisCells="4" launcher:longAxisCells="6"
(2)修改widget
这样调整后,laucher home screen的icon变为6行,6列,显得比较紧凑了。但是search widget就比较别扭了,只占据了左边的一部分,并没有占据整个第一行。那么如何解决这个问题?
调整Android_src/packages/apps/Launcher/src/com/android/launcher/Widget.java
/**
* Represents one instance of a Launcher widget, such as search.
*/
class Widget extends ItemInfo {
int layoutResource;
static Widget makeSearch() {
Widget w = new Widget();
w.itemType = LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH;
w.spanX = 4;
w.spanY = 1;
w.layoutResource = R.layout.widget_search;
return w;
}
}
修改为:
w.spanX = 6;
w.spanY = 1;
8. 删除默认widget
(1) 删除数据库
launcherProvide.java
launcher.db