Android does not display power on wizard and power on bubble

Modified code download address:
https://github.com/Vico-H/Launcher

The source code of Launcher2.java is as follows:

······
public void showFirstRunWorkspaceCling() {
        // Enable the clings only if they have not been dismissed before
        if (isClingsEnabled() &&
                !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&//Change false to true here
                !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)) {//Change false to true here
            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)) {//Change false to true here
            return initCling(R.id.folder_cling, null, true, 0);
        } else {
            removeCling(R.id.folder_cling);
            return null;
        }
    }
······

Amend to read:

-   !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)) 
  • Do not show power on bubble

    There is a need to turn on the machine without the bubble shown in the picture below

Modify the code of Launcher3.java
(file location: alps/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java)
Check the source code of the website:
https://www.androidos.net.cn/android/6.0.1_r16/xref/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java

The source code of Launcher3.java is as follows:

······
protected void onCreate(Bundle savedInstanceState) {
        ······
        if (shouldShowIntroScreen()) {
                    showIntroScreen();
                } else {
                    showFirstRunActivity();
                    showFirstRunClings();//Comment on this line
                }
}
······

Note out the following line directly and there will be no power on bubble

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


I am still a beginner in Android. The article is for recording. If there is any mistake, please correct it!!!


Keywords: Android Java github

Added by andrew10181 on Tue, 12 Nov 2019 19:14:38 +0200