Android R Automotive底部导航栏打开关闭

开发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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值