[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() {
相关推荐
Kwanvin13 天前
Android13 Hotseat客制化--Hotseat修改布局、支持滑动、去掉开机弹动效果、禁止创建文件夹
android·java·launcher3·hotseat
Kwanvin19 天前
仿华为车机UI--图标从Workspace拖动到Hotseat同时保留图标在原来位置
android·java·ui·华为·launcher3
毛豆的毛豆Y21 天前
Android13--移除最近任务长按图标弹出菜单
android13·launcher3
42nf2 个月前
Android Launcher3桌面图标样式修改(添加圆角)
android·launcher3
suifen_3 个月前
RK3588 Android13自定义一个按键实现长按短按
linux·驱动开发·rk3588·android13
林多10 个月前
【Android】Android Framework系列--Launcher3各启动场景源码分析
android·启动·launcher·launcher3·home
Mr. 码农10 个月前
[P7885][Android13] 解决5G信号良好状态栏信号只有两格的问题
android13·p7885·展锐5g·信号格数
Mr. 码农10 个月前
[QCM6125][Android10] 系统设置隐藏搜索栏以及右上角的搜索按钮
系统设置·qcm6125·搜索·android10·setting
Mr. 码农1 年前
[QCM6125][Android13] 解决应用调用静态广播无法接收到的问题
android13·qcm6125·静态广播·setcomponent