[QCM6125][Android13] 屏蔽Launcher3桌面的搜索栏

文章目录

开发平台基本信息

芯片: QCM6125
版本: Android 13
kernel: msm-4.14

解决方法

  • 去掉原生Launcher3桌面的搜索栏
java 复制代码
--- a/packages/apps/Launcher3/res/layout/search_container_workspace.xml
+++ b/packages/apps/Launcher3/res/layout/search_container_workspace.xml
@@ -22,9 +22,9 @@
         android:id="@id/search_container_workspace"
         android:padding="0dp" >
 
-    <fragment
+    <!-- <fragment
         android:name="com.android.launcher3.qsb.QsbContainerView$QsbFragment"
         android:layout_width="match_parent"
         android:tag="qsb_view"
-        android:layout_height="match_parent"/>
+        android:layout_height="match_parent"/> -->
 </com.android.launcher3.qsb.QsbContainerView>

--- a/packages/apps/Launcher3/src/com/android/launcher3/Workspace.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/Workspace.java
@@ -592,15 +592,16 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
                     .inflate(R.layout.search_container_workspace, firstPage, false);
         }
 
-        int cellVSpan = FeatureFlags.EXPANDED_SMARTSPACE.get()
-                ? EXPANDED_SMARTSPACE_HEIGHT : DEFAULT_SMARTSPACE_HEIGHT;
-        int cellHSpan = mLauncher.getDeviceProfile().inv.numSearchContainerColumns;
-        CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, cellHSpan, cellVSpan);
-        lp.canReorder = false;
-        if (!firstPage.addViewToCellLayout(mQsb, 0, R.id.search_container_workspace, lp, true)) {
-            Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout");
-            mQsb = null;
-        }
+        // int cellVSpan = FeatureFlags.EXPANDED_SMARTSPACE.get()
+        //         ? EXPANDED_SMARTSPACE_HEIGHT : DEFAULT_SMARTSPACE_HEIGHT;
+        // int cellHSpan = mLauncher.getDeviceProfile().inv.numSearchContainerColumns;
+        // CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, cellHSpan, cellVSpan);
+        // lp.canReorder = false;
+        // if (!firstPage.addViewToCellLayout(mQsb, 0, R.id.search_container_workspace, lp, true)) {
+        //     Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout");
+        //     mQsb = null;
+        // }
+        mQsb = null;
     }
 
     public void removeAllWorkspaceScreens() {
相关推荐
ItJavawfc6 天前
MTKAndroid13-Launcher3 屏蔽部分app不让显示
launcher3·隐藏app·ui 影藏·mtkandroid13
毛豆的毛豆Y9 天前
AOSP Android14 Launcher3——动画核心类QuickstepTransitionManager详解
aosp·launcher3·android14
毛豆的毛豆Y14 天前
AOSP Android14 Launcher3——RecentsView最近任务数据加载
aosp·launcher3·android14
毛豆的毛豆Y14 天前
AOSP Android14 Launcher3——点击桌面图标启动应用动画流程
aosp·launcher3·android14
毛豆的毛豆Y15 天前
AOSP Android14 Launcher3——远程窗口动画关键类SurfaceControl详解
aosp·launcher3·android14
毛豆的毛豆Y21 天前
AOSP Android14 Launcher3——底部任务栏Taskbar详解
aosp·launcher3·android14
a3158238063 个月前
Android设置个性化按钮按键的快捷启动应用
android·开发语言·framework·源码·android13
Sgq丶5 个月前
Android 13 aosp Launcher 隐藏“壁纸和样式“入口
android·aosp·launcher3
ItJavawfc6 个月前
Launcher3 去掉桌面搜索索框
launcher3·去掉搜索框·谷歌搜索框
XueminXu7 个月前
Win11禁止搜索栏查找互联网内容
win11·windows 11·搜索栏·搜索框·查找互联网内容·搜索互联网内容