修改好的代码下载地址:
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)) 
  • 不显示开机气泡


    有个需求是开机不要下面这个图片所示的气泡
    Android不显示开机向导和开机气泡_第1张图片

修改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. Android视频播放器源码
  2. Android预安装软件&adb命令&编译源码
  3. Android查看网页源码与开启子线程
  4. Android 4.0.3 源码编译中添加外部jar包和外部so到apk的方法
  5. Android开发/源码资源汇总
  6. 2017 github 上android 源码(适合工作中开发)
  7. 2014.01.21 ——— android 关联android-support源码
  8. Android内容提供者源码
  9. android源码下载方式

随机推荐

  1. 内容提供者相关技术
  2. AsyncTask 学习翻译并总结
  3. android XML解析技术
  4. Ubuntu 14.04 LTS 安装 文泉驿微米黑 字
  5. 子线程新建Handler为什么会报错?——浅谈H
  6. Android(安卓)Jni 开发(Android(安卓)stud
  7. Android应用程序消息处理机制(Looper、Han
  8. Android(安卓)packageManagerService如何
  9. android之绕Y轴旋转
  10. App"确定"按钮应该在左边还是右边?