当前位置: 萬仟网 > IT编程>移动>Android > Android不显示开机向导和开机气泡

Android不显示开机向导和开机气泡

2019年05月13日 07:34  | 萬仟网IT编程  | 我要评论

修改好的代码下载地址:
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();//注释此行即可
                }
}
······

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

-    showfirstrunclings();
+    //showfirstrunclings();


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


如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

◎已有 0 人评论

Copyright © 2019  萬仟网 保留所有权利. 粤ICP备17035492号-1
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com