[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() {
相关推荐
Windra69 天前
Android13后长按电源键实现关机
android13
毛豆的毛豆Y13 天前
AOSP 14 Launcher3 - Taskbar UI 组成
aosp·launcher3·android14
科技道人6 个月前
Android15 launcher3
android·launcher3·android15·hotseat
ItJavawfc7 个月前
MTKAndroid13-Launcher3 屏蔽部分app不让显示
launcher3·隐藏app·ui 影藏·mtkandroid13
毛豆的毛豆Y7 个月前
AOSP Android14 Launcher3——动画核心类QuickstepTransitionManager详解
aosp·launcher3·android14
毛豆的毛豆Y7 个月前
AOSP Android14 Launcher3——RecentsView最近任务数据加载
aosp·launcher3·android14
毛豆的毛豆Y7 个月前
AOSP Android14 Launcher3——点击桌面图标启动应用动画流程
aosp·launcher3·android14
毛豆的毛豆Y7 个月前
AOSP Android14 Launcher3——远程窗口动画关键类SurfaceControl详解
aosp·launcher3·android14
毛豆的毛豆Y7 个月前
AOSP Android14 Launcher3——底部任务栏Taskbar详解
aosp·launcher3·android14
a31582380610 个月前
Android设置个性化按钮按键的快捷启动应用
android·开发语言·framework·源码·android13