嵌入式爱好者

Android7.1.1之去掉workspace顶部的快速搜索条Qsb

2021-7-30 16:15| 发布者: yangy| 查看: 536| 评论: 0

类目: A40i/T3系列产品  >  Android     文档编号: 525

android/packages/apps/QuickSearchBox/Android.mk重命名为android/packages/apps/QuickSearchBox/Android.txt
修改Launch3
diff --git a/packages/apps/Launcher3/res/layout/qsb_default_view.xml b/packages/apps/Launcher3/res/layout/qsb_default_view.xml
index 82bdea5..ab8a1df 100755
--- a/packages/apps/Launcher3/res/layout/qsb_default_view.xml
+++ b/packages/apps/Launcher3/res/layout/qsb_default_view.xml
@@ -18,7 +18,7 @@
              android:layout_width="match_parent"
              android:layout_height="match_parent">
 
-    <LinearLayout
+    <!--LinearLayout
         android:layout_width="match_parent"
         android:layout_height="48dp"
         android:layout_margin="16dp"
@@ -50,5 +50,5 @@
             android:contentDescription="@string/gadget_setup_text"
             android:padding="8dp"
             android:background="?android:attr/selectableItemBackground" />
-    </LinearLayout>
-</FrameLayout>
\ No newline at end of file
+    </LinearLayout-->
+</FrameLayout>
diff --git a/packages/apps/Launcher3/src/com/android/launcher3/QsbContainerView.java b/packages/apps/Launcher3/src/com/android/launcher3/QsbContainerView.java
index 02d8a13..8dd66e5 100755
--- a/packages/apps/Launcher3/src/com/android/launcher3/QsbContainerView.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/QsbContainerView.java
@@ -164,18 +164,6 @@ public class QsbContainerView extends FrameLayout {
 
         @[Override](/member/Override)          public void onClick(View view) {
-            if (view.getId() == R.id.btn_qsb_search) {
-                getActivity().startSearch("", false, null, true);
-            } else if (view.getId() == R.id.btn_qsb_setup) {
-                // Allocate a new widget id for QSB
-                sSavedWidgetId = Launcher.getLauncher(getActivity())
-                        .getAppWidgetHost().allocateAppWidgetId();
-                // Start intent for bind the widget
-                Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_BIND);
-                intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, sSavedWidgetId);
-                intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER, mWidgetInfo.provider);
-                startActivityForResult(intent, REQUEST_BIND_QSB);
-            }
         }
 
         @[Override](/member/Override) @@ -224,12 +212,6 @@ public class QsbContainerView extends FrameLayout {
 
         private View getDefaultView(LayoutInflater inflater, ViewGroup parent, boolean showSetup) {
             View v = inflater.inflate(R.layout.qsb_default_view, parent, false);
-            if (showSetup) {
-                View setupButton = v.findViewById(R.id.btn_qsb_setup);
-                setupButton.setVisibility(View.VISIBLE);
-                setupButton.setOnClickListener(this);
-            }
-            v.findViewById(R.id.btn_qsb_search).setOnClickListener(this);
             return v;
         }
     }

已解决

未解决

只是看看

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-11-23 19:06

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部