RK:Launcher3 禁用快捷方式、禁用壁纸小控件、隐藏指定应用图标

 

1.Android7.1  禁用快捷方式

  https://www.jianshu.com/p/d5370946c672?utm_campaign=haruki  墨香带你学Launcher之(六)--拖拽

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/packages/apps/Launcher3/src/com/android/launcher3/CellLayout.java b/packages/apps/Launcher3/src/com/android/launcher3/CellLayout.java
old mode 100644
new mode 100755
index 57fd0e7..3a05448
--- a/packages/apps/Launcher3/src/com/android/launcher3/CellLayout.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/CellLayout.java
@@ -2390,7 +2390,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
         } else if (noShuffleSolution.isSolution) {
             finalSolution = noShuffleSolution;
         }
-
+        finalSolution = null;
         if (mode == MODE_SHOW_REORDER_HINT) {
             if (finalSolution != null) {
                 beginOrAdjustReorderPreviewAnimations(finalSolution, dragView, 0,

2.Android5.1 Launcher长按,隐藏壁纸、小控件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff --git a/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java b/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
index f6049e8..a4a3a02 100755
--- a/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
@@ -140,7 +140,7 @@ public class Launcher extends Activity
                    View.OnTouchListener, PageSwitchListener, LauncherProviderChangeListener {
     static final String TAG = "Launcher";
     static final float ALL_APPS_ALPHA = 0f;
-    static final boolean LOGD = false;
+    static final boolean LOGD = true;
  
     static final boolean PROFILE_STARTUP = false;
     static final boolean DEBUG_WIDGETS = false;
@@ -1404,6 +1404,7 @@ public class Launcher extends Activity
  
         mOverviewPanel = (ViewGroup) findViewById(R.id.overview_panel);
         View widgetButton = findViewById(R.id.widget_button);
+       widgetButton.setVisibility(View.GONE);
         widgetButton.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View arg0) {
@@ -1415,6 +1416,7 @@ public class Launcher extends Activity
         widgetButton.setOnTouchListener(getHapticFeedbackTouchListener());
  
         View wallpaperButton = findViewById(R.id.wallpaper_button);
+       wallpaperButton.setVisibility(View.GONE);
         wallpaperButton.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View arg0) {

3.Android5.1 Launcher3 隐藏指定应用图标  

https://blog.csdn.net/paullovazxq/article/details/52154468 Android5.1 Launcher3 隐藏指定应用图标 西门萝卜

  3.1.直接改清单文件 

1
2
-                <category android:name="android.intent.category.LAUNCHER" />
+                <!--<category android:name="android.intent.category.LAUNCHER" />-->

  3.2.loadAllApps()方法,其中将所有应用的信息添加到数组

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
     boolean startActivitySafely(View v, Intent intent, Object tag) {
         boolean success = false;
diff --git a/packages/apps/Launcher3/src/com/android/launcher3/LauncherModel.java b/packages/apps/Launcher3/src/com/android/launcher3/LauncherModel.java
index 28670f4..3af9a68 100755
--- a/packages/apps/Launcher3/src/com/android/launcher3/LauncherModel.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/LauncherModel.java
@@ -2887,7 +2887,12 @@ public class LauncherModel extends BroadcastReceiver
                 // Create the ApplicationInfos
                 for (int i = 0; i < apps.size(); i++) {
                     LauncherActivityInfoCompat app = apps.get(i);
+                   //Log.d("gatsby","packageName->"+apps.get(i).getApplicationInfo().packageName);
                     // This builds the icon bitmaps.
+                      
+                   if("com.android.providers.downloads.ui".equals(apps.get(i).getApplicationInfo().packageName)){
+                   continue;
+                   }
                     mBgAllAppsList.add(new AppInfo(mContext, app, user, mIconCache, mLabelCache));
                 }

  

  

posted @   CrushGirl  阅读(877)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
点击右上角即可分享
微信分享提示