修改好的代码下载地址:

https://github.com/Vico-H/Launcher

  • 不显示开机向导

    ===========

修改Launcher2.java的代码
(文件位置: /alps/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java)
网站查看源码:
https://www.androidos.net.cn/android/6.0.1_r16/xref/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java

Launcher2.java部分源码如下:

······
public void showFirstRunWorkspaceCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&//此处false改为true
!skipCustomClingIfNoAccounts() ) {
// If we're not using the default workspace layout, replace workspace cling
// with a custom workspace cling (usually specified in an overlay)
// For now, only do this on tablets
if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0 &&
getResources().getBoolean(R.bool.config_useCustomClings)) {
// Use a custom cling
View cling = findViewById(R.id.workspace_cling);
ViewGroup clingParent = (ViewGroup) cling.getParent();
int clingIndex = clingParent.indexOfChild(cling);
clingParent.removeViewAt(clingIndex);
View customCling = mInflater.inflate(R.layout.custom_workspace_cling, clingParent, false);
clingParent.addView(customCling, clingIndex);
customCling.setId(R.id.workspace_cling);
}
initCling(R.id.workspace_cling, null, false, 0);
} else {
removeCling(R.id.workspace_cling);
}
}
public void showFirstRunAllAppsCling(int[] position) {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false)) {//此处false改为true
initCling(R.id.all_apps_cling, position, true, 0);
} else {
removeCling(R.id.all_apps_cling);
}
}
public Cling showFirstRunFoldersCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false)) {//此处false改为true
return initCling(R.id.folder_cling, null, true, 0);
} else {
removeCling(R.id.folder_cling);
return null;
}
}
······

修改如下:

-   !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&
+ !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, true) &&
-   !mSharedPrefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false))
+ !mSharedPrefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, true))
-   !mSharedPrefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false))
+ !mSharedPrefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, true))
  • 不显示开机气泡

    =======

有个需求是开机不要下面这个图片所示的气泡
![](https://img2018.cnblogs.com/blog/1678519/201905/1678519-20190512122025963-280615933.png)

修改Launcher3.java的代码

(文件位置: /alps/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java)

网站查看源码:

https://www.androidos.net.cn/android/6.0.1_r16/xref/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java

Launcher3.java部分源码如下:

······
protected void onCreate(Bundle savedInstanceState) {
······
if (shouldShowIntroScreen()) {
showIntroScreen();
} else {
showFirstRunActivity();
showFirstRunClings();//注释此行即可
}
}
······

将下面的直接的这行注释掉就不会有开机气泡了

-    showFirstRunClings();
+ //showFirstRunClings();

本人还是初涉Android,文章用于记录,如有错误望指正!!!

最新文章

  1. 为jQuery添加Webkit的触摸方法支持
  2. Web APi之控制器选择Action方法过程(九)
  3. Android上的事件流操作数据库
  4. React/React Native 的ES5 ES6写法对照表
  5. Android忽略文件以及.gitignore规则不生效的可行解决方案
  6. Nginx的虚拟服务器域名配置
  7. Python之sqlite3
  8. Reactor三种线程模型与Netty线程模型
  9. spring boot 注解
  10. Codeforces 659G Fence Divercity dp
  11. 使用netfilter_queue改包笔记
  12. mysql、mybatis遇到问题集合
  13. C++生成斐波拉其数列
  14. Pl/SQl 安装和配置Oracle 数据库连接
  15. TCP Socket 粘包
  16. Python min() 方法
  17. DB_FILE_MULTIBLOCK_READ_COUNT对物理读和IO次数的影响
  18. 第一百六十三节,jQuery,基础核心
  19. HDU - 4081 Qin Shi Huang's National Road System 【次小生成树】
  20. HTML5+JavaScript动画基础 完整版 中文pdf扫描版

热门文章

  1. ACM-后序遍历(简单方法和正规方法)
  2. 【转】Restful架构详解
  3. 鲜贝7.3--mysql安装
  4. 《CarbonData》
  5. hasattr、getattr、setattr、delattr、反射
  6. 记 2019蓝桥杯校内预选赛(JAVA组) 赛后总结
  7. 安装Microsoft Office 2010 提示需要安装MSXML版本6.10.1129.0 的解决方案
  8. 数据仓库003 - 复习Linux shell命令 - 用户用户组 sudo 权限 du-sh find 
  9. ​为什么我会选择走 Java 这条路?
  10. Flutter基础系列之混合开发(二)