开发Android车机的时候遇到的一个问题,Android Automotive版本底部有一个导航栏,如果需要打开或关闭通过以下patch进行修改即可(当前版本是Android R)
From 0c02f9be3e9425e71ed2d1639d866e8ba7589c66 Mon Sep 17 00:00:00 2001
Date: Wed, 23 Feb 2022 10:11:56 +0800
Subject: [PATCH] feat: restore navigation bar
Change-Id: I1deec27852b1f987e5e33658e1e79362be8402ff
---
core/res/res/values/dimens.xml | 8 ++++----
packages/CarSystemUI/res/layout/super_status_bar.xml | 1 -
packages/CarSystemUI/res/values/config.xml | 4 ++--
3 files changed, 6 insertions(+), 7 deletions(-)
/framework/base/
diff --git a/framework/base/core/res/res/values/dimens.xml b/framework/base/core/res/res/values/dimens.xml
index 7e54391e..d165930d 100644
--- a/framework/base/core/res/res/values/dimens.xml
+++ b/framework/base/core/res/res/values/dimens.xml
@@ -35,7 +35,7 @@
<dimen name="status_bar_height">@dimen/status_bar_height_portrait</dimen>
<!-- Height of the status bar in portrait. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
- <dimen name="status_bar_height_portrait">0dp</dimen>
+ <dimen name="status_bar_height_portrait">24dp</dimen>
<!-- Height of the status bar in landscape. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
<dimen name="status_bar_height_landscape">@dimen/status_bar_height_portrait</dimen>
@@ -46,11 +46,11 @@
<!-- Total height of QQS with two rows to fit media player (quick_qs_offset_height + 176) -->
<dimen name="quick_qs_total_height_with_media">224dp</dimen>
<!-- Height of the bottom navigation / system bar. -->
- <dimen name="navigation_bar_height">0dp</dimen>
+ <dimen name="navigation_bar_height">48dp</dimen>
<!-- Height of the bottom navigation bar in portrait; often the same as @dimen/navigation_bar_height -->
- <dimen name="navigation_bar_height_landscape">0dp</dimen>
+ <dimen name="navigation_bar_height_landscape">48dp</dimen>
<!-- Width of the navigation bar when it is placed vertically on the screen -->
- <dimen name="navigation_bar_width">0dp</dimen>
+ <dimen name="navigation_bar_width">48dp</dimen>
<!-- How much we expand the touchable region of the status bar below the notch to catch touches
that just start below the notch. -->
<dimen name="display_cutout_touchable_region_size">12dp</dimen>
diff --git a/framework/base/packages/CarSystemUI/res/layout/super_status_bar.xml b/framework/base/packages/CarSystemUI/res/layout/super_status_bar.xml
index c1d179d8..d93f62f8 100644
--- a/framework/base/packages/CarSystemUI/res/layout/super_status_bar.xml
+++ b/framework/base/packages/CarSystemUI/res/layout/super_status_bar.xml
@@ -23,7 +23,6 @@
xmlns:sysui="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:visibility="gone"
android:fitsSystemWindows="true">
<LinearLayout
diff --git a/framework/base/packages/CarSystemUI/res/values/config.xml b/framework/base/packages/CarSystemUI/res/values/config.xml
index 90364ac1..cf967c02 100644
--- a/framework/base/packages/CarSystemUI/res/values/config.xml
+++ b/framework/base/packages/CarSystemUI/res/values/config.xml
@@ -25,10 +25,10 @@
<bool name="config_enableFullscreenUserSwitcher">true</bool>
<!-- configure which system ui bars should be displayed -->
- <bool name="config_enableTopNavigationBar">false</bool>
+ <bool name="config_enableTopNavigationBar">true</bool>
<bool name="config_enableLeftNavigationBar">false</bool>
<bool name="config_enableRightNavigationBar">false</bool>
- <bool name="config_enableBottomNavigationBar">false</bool>
+ <bool name="config_enableBottomNavigationBar">true</bool>
<!-- Disable normal notification rendering; we handle that ourselves -->
<bool name="config_renderNotifications">false</bool>
--
2.25.1