Android 11.0 GMS版本将Google搜索框移到顶部修改方法

前言

带有GMS包的软件会发现如下图所示的Google 搜索栏在底部的位置,但是怎么找 packages/app/Launcher3 中的代码都没有找到这个Google 搜索框的位置,其实它是GMS包中overlay 控制的一个wediget控件,他的代码位置是xxx你的 gms包目录/packages/apps/Google/google/apps/SearchLauncher,只要将其全部删除就可以了。来看看修改前后的界面效果:

【修改前界面】

一开始的时候我以为是在SystemUI里面控制的导航栏旋转界面切换,但是发现并不是这样,其实是跟
framework中的 R.bool.config_navBarCanMove 这个变量有关,具体代码修改很简单,如下:

	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/res/layout/search_container_all_apps.xml
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/res/layout/search_container_workspace.xml
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/res/layout/smart_space_date_view.xml
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/res/values/dimens.xml
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/src/com/android/searchlauncher/HotseatQsbWidget.java
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/src/com/android/searchlauncher/QuickstepSettingsFragment.java
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/src/com/android/searchlauncher/SmartSpaceHostView.java
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/quickstep/src/com/android/searchlauncher/SmartspaceQsbWidget.java
	deleted:    teksun/packages/apps/Google/google/apps/SearchLauncher/res/values/settings_overrides.xml


【修改后Google搜索栏界面】

你可能感兴趣的:(安卓基础篇,Launcher)