Android不顯示開機向?qū)Ш烷_機氣泡問題
修改好的代碼下載地址:
https://github.com/Vico-H/Launcher
•不顯示開機向?qū)?/p>
--------------------------------------------------------------------------------
修改Launcher2.java的代碼
(文件位置: /alps/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java)
網(wǎng)站查看源碼:
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)
網(wǎng)站查看源碼:
Launcher3.java部分源碼如下:
······
protected void onCreate(Bundle savedInstanceState) {
······
if (shouldShowIntroScreen()) {
showIntroScreen();
} else {
showFirstRunActivity();
showFirstRunClings();//注釋此行即可
}
}
······
將下面的直接的這行注釋掉就不會有開機氣泡了
- showFirstRunClings(); + //showFirstRunClings();
總結(jié)
以上所述是小編給大家介紹的Android不顯示開機向?qū)Ш烷_機氣泡問題,希望對大家有所幫助,如果大家有任何歡迎給我留言,小編會及時回復(fù)大家的!
相關(guān)文章
OpenGL關(guān)于glStencilFuncSeparate()和glStencilFunc()函數(shù)的區(qū)別講解
今天小編就為大家分享一篇OpenGL關(guān)于glStencilFuncSeparate()和glStencilFunc()函數(shù)的區(qū)別講解,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2019-04-04
Android仿微信底部菜單欄功能顯示未讀消息數(shù)量
這篇文章主要介紹了Android仿微信底部菜單欄功能,并顯示未讀消息數(shù)量,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-05-05
Android通過RemoteViews實現(xiàn)跨進(jìn)程更新UI示例
本篇文章主要介紹了Android通過RemoteViews實現(xiàn)跨進(jìn)程更新UI示例,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-02-02
解決Eclipse創(chuàng)建android項目無法正常預(yù)覽布局文件問題的方法
這篇文章主要介紹了解決Eclipse創(chuàng)建android項目無法正常預(yù)覽布局文件問題的方法,需要的朋友可以參考下2015-12-12
Android自定義View實現(xiàn)葉子飄動旋轉(zhuǎn)效果(四)
這篇文章主要為大家詳細(xì)介紹了Android自定義View實現(xiàn)葉子飄動旋轉(zhuǎn)效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-03-03
Android音頻系統(tǒng)AudioTrack使用方法詳解
這篇文章主要為大家詳細(xì)介紹了Android音頻系統(tǒng)AudioTrack的使用方法,如何使用AudioTrack進(jìn)行音頻播放,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-07-07

