Android不顯示開機(jī)向?qū)Ш烷_機(jī)氣泡問題
修改好的代碼下載地址:
https://github.com/Vico-H/Launcher
•不顯示開機(jī)向?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))
•不顯示開機(jī)氣泡
--------------------------------------------------------------------------------
有個(gè)需求是開機(jī)不要下面這個(gè)圖片所示的氣泡
修改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();//注釋此行即可 } } ······
將下面的直接的這行注釋掉就不會(huì)有開機(jī)氣泡了
- showFirstRunClings(); + //showFirstRunClings();
總結(jié)
以上所述是小編給大家介紹的Android不顯示開機(jī)向?qū)Ш烷_機(jī)氣泡問題,希望對(duì)大家有所幫助,如果大家有任何歡迎給我留言,小編會(huì)及時(shí)回復(fù)大家的!
- android 仿微信聊天氣泡效果實(shí)現(xiàn)思路
- Android氣泡效果實(shí)現(xiàn)方法
- Android實(shí)現(xiàn)氣泡布局/彈窗效果 氣泡尖角方向及偏移量可控
- Android貝塞爾曲線初步學(xué)習(xí)第二課 仿QQ未讀消息氣泡拖拽黏連效果
- Android帶氣泡的第三方Tab選項(xiàng)卡
- Android使用貝塞爾曲線仿QQ聊天消息氣泡拖拽效果
- Android使用ViewDragHelper實(shí)現(xiàn)QQ聊天氣泡拖動(dòng)效果
- Android Q之氣泡彈窗的實(shí)現(xiàn)示例
- Android實(shí)現(xiàn)氣泡動(dòng)畫
- Android自定義View實(shí)現(xiàn)氣泡動(dòng)畫
相關(guān)文章
Kotlin FrameLayout與ViewPager2控件實(shí)現(xiàn)滾動(dòng)廣告欄方法
這篇文章主要介紹了Kotlin FrameLayout與ViewPager2控件實(shí)現(xiàn)滾動(dòng)廣告欄,F(xiàn)rameLayout與ViewPager2是Android開發(fā)中非常常見的布局組件,并且它不單單是一個(gè)幀布局組件,可以用它實(shí)現(xiàn)多種功能,感興趣的朋友一起來看看吧2022-12-12Android Bitmap和Drawable的對(duì)比
這篇文章主要介紹了Android Bitmap和Drawable的對(duì)比的相關(guān)資料,需要的朋友可以參考下2017-05-05如何正確實(shí)現(xiàn)Android啟動(dòng)屏畫面的方法(避免白屏)
本篇文章主要介紹了如何正確實(shí)現(xiàn)Android啟動(dòng)屏畫面的方法(避免白屏),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-02-02Android 使用Vibrator服務(wù)實(shí)現(xiàn)點(diǎn)擊按鈕帶有震動(dòng)效果
這篇文章主要介紹了Android 使用Vibrator服務(wù)實(shí)現(xiàn)點(diǎn)擊按鈕帶有震動(dòng)效果,,本文通過實(shí)例圖文相結(jié)合給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)火鍋工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-06-06Android實(shí)現(xiàn)可播放GIF動(dòng)畫的ImageView
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)可播放GIF動(dòng)畫的ImageView,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-09-09Android應(yīng)用中內(nèi)嵌SQLite數(shù)據(jù)庫的基本操作指南
這篇文章主要介紹了Android應(yīng)用中內(nèi)嵌SQLite數(shù)據(jù)庫的基本操作指南,包括創(chuàng)建DAO類接口以及相關(guān)的增刪查改等操作的明說,需要的朋友可以參考下2016-02-02