设为首页 加入收藏

TOP

Android不显示开机向导和开机气泡(一)
2019-08-26 06:27:19 】 浏览:58
Tags:Android 显示 开机 向导 气泡

修改好的代码下载地址:
https://github.com/Vico-H/Launcher

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)) 
  • 不显示开机气泡


    有个需求是开机不要下面这个图片所示的气泡

修改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();//注释此行即可
                }
}
·
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Context 下一篇Android 8.1 SystemUI虚拟导航键..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目