1.去掉Google搜索栏
目录packages/apps/Launcher3/src_build_config/com/android/launcher3/BuildConfig.java
修改如下:
2.Launcher首页去掉抽屉菜单,所有应用都放到桌面
第一步:禁止上滑显示抽屉
在目录packages/apps/Launcher3/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java下 修改
第二步:加载所有应用
在目录packages/apps/Launcher3/src/com/android/launcher3/model/LoaderTask.java下修改
在目录packages/apps/Launcher3/src/com/android/launcher3/model/ItemInstallQueue.java修改
// 修改private为public
public static class PendingInstallShortcutInfo extends ItemInfo {}
第三步:安装的app添加到工作区
在目录packages/apps/Launcher3/src/com/android/launcher3/model/PackageUpdatedTask.java下
//安装的app添加到workspace工作区
public void updateToWorkSpace(Context context, LauncherAppState app, AllAppsList appsList){
Log.d(TAG,"updateToWorkSpace");
ArrayList<Pair<ItemInfo,Object>> installQueue = new ArrayList<>();
UserManager mUserManager = app.getContext().getSystemService(UserManager.class);
final List<UserHandle> profiles = mUserManager.getUserProfiles();
ArrayList<ItemInstallQueue.PendingInstallShortcutInfo> added = new ArrayList<>();
LauncherApps mLauncherApps = app.getContext().getSystemService(LauncherApps.class);
for(UserHandle user : profiles){
final List<LauncherActivityInfo> apps = mLauncherApps.getActivityList(null,user);
synchronized (this){
for(LauncherActivityInfo info :apps){
for(AppInfo appInfo : appsList.data){
String packageName = info.getComponentName().getPackageName();
if(info.getComponentName().equals(appInfo.componentName)){
if(DEBUG){
Log.d(TAG,"updateToWorkSpace packageName: " + packageName);
}
ItemInstallQueue.PendingInstallShortcutInfo mPendingInstallShortcutInfo
= new ItemInstallQueue.PendingInstallShortcutInfo(packageName,user);
added.add(mPendingInstallShortcutInfo);
installQueue.add(mPendingInstallShortcutInfo.getItemInfo(context));
}
}
}
}
}
if(!added.isEmpty()){
app.getModel().addAndBindAddedWorkspaceItems(installQueue);
}
}
=
第四步:打开限制
清除数据重新加载还能加载图标
packages/apps/Launcher3/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
这里不做修改的话如果清除所有数据,那么图标就不会加载
packages/apps/Launcher3/src/com/android/launcher3/model/BaseModelUpdateTask.java
第五步:顶部菜单移除remove换成取消cancel,无法移除
packages/apps/Launcher3/src/com/android/launcher3/DeleteDropTarget.java
无法删除图标
packages/apps/Launcher3/src/com/android/launcher3/dragndrop/DragController.java
private boolean isNeedCancelDrag(ItemInfo item){
return (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
item.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER);
}
好了 至此 修改完成!