- 隐藏虚拟按键跟状态栏
- 修改文件: frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi,nfc,wimax</string> + <string name="policy_control" translatable="false">immersive.full=*</string> <string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi,nfc</string>
policy_control 有三种值:
全屏沉浸模式(包括状态栏和虚拟按键): immersive.full=*
沉浸状态栏:immersive.status=*
沉浸虚拟按键(隐藏后底部上划可以呼出): immersive.navigation=*
恢复正常模式(如果隐藏了状态栏或者虚拟按键但是又不想用了):null
-
修改文件: frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
函数 private void loadGlobalSettings(SQLiteDatabase db) 中加上如下代码: loadBooleanSetting(stmt, Settings.Global.AIRPLANE_MODE_ON, R.bool.def_airplane_mode_on); + loadStringSetting(stmt, Settings.Global.POLICY_CONTROL, + R.string.policy_control); loadBooleanSetting(stmt, Settings.Global.THEATER_MODE_ON, R.bool.def_theater_mode_on);
Settings.Global.POLICY_CONTROL 定义在: frameworks/base/core/java/android/provider/Settings.java中
- 修改文件: frameworks/base/packages/SettingsProvider/res/values/defaults.xml
-
除去google搜索栏
-
修改文件:packages/apps/Launcher3/res/layout/search_container_workspace.xml
+<!--- <fragment android:name="com.android.launcher3.qsb.QsbContainerView$QsbFragment" android:layout_width="match_parent" android:tag="qsb_view" android:layout_height="match_parent"/> +--> 将以上注释掉 </com.android.launcher3.qsb.QsbContainerView>
-
修改文件:packages/apps/Launcher3/src/com/android/launcher3/Workspace.java
在函数: public void bindAndInitFirstWorkspaceScreen(View qsb) 中 +/* 除去Launcher3 自带的google 搜索框 CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, firstPage.getCountX(), 1); lp.canReorder = false; if (!firstPage.addViewToCellLayout(qsb, 0, R.id.search_container_workspace, lp, true)) { Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout"); } + */ 注释掉以上代码即可
-
【Android】Android 9.0 隐藏虚拟按键跟状态栏,除去google搜索栏.
最新推荐文章于 2022-03-11 11:15:21 发布