diff options
author | 2023-02-21 23:16:36 +0800 | |
---|---|---|
committer | 2023-02-21 23:16:36 +0800 | |
commit | c2e18524b632127d0e00c3535f9e340e5339f267 (patch) | |
tree | 437a0aae240542db0ea8fcd4d14eb50155329581 | |
parent | e835a95134ffaeb2e2bd4b018b2d2f8fc7908825 (diff) |
Add an overlay package to enable config_navBarDefaultTransparent
This is used by the developer option.
Fix: 232195501
Test: Enable transparent navigation bar from developer options and see
if the navigation bar background is transparent in NetGrapher.
Change-Id: I33addaeaec2a1f21f1a4ea03b62e090cca5600b9
7 files changed, 110 insertions, 0 deletions
diff --git a/data/etc/preinstalled-packages-platform-overlays.xml b/data/etc/preinstalled-packages-platform-overlays.xml index 6f6390b19dff..99594336999b 100644 --- a/data/etc/preinstalled-packages-platform-overlays.xml +++ b/data/etc/preinstalled-packages-platform-overlays.xml @@ -53,6 +53,9 @@ <install-in-user-type package="com.android.internal.systemui.onehanded.gestural"> <install-in user-type="FULL" /> </install-in-user-type> + <install-in-user-type package="com.android.internal.systemui.navbar.transparent"> + <install-in user-type="FULL" /> + </install-in-user-type> <install-in-user-type package="com.android.theme.color.amethyst"> <install-in user-type="FULL" /> <install-in user-type="PROFILE" /> diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml index b92b3d665675..b628b80dab2c 100644 --- a/packages/SettingsLib/res/values/strings.xml +++ b/packages/SettingsLib/res/values/strings.xml @@ -868,6 +868,11 @@ <!-- UI debug setting: force right to left layout summary [CHAR LIMIT=100] --> <string name="force_rtl_layout_all_locales_summary">Force screen layout direction to RTL for all locales</string> + <!-- UI debug setting: make navigation bar background color transparent by default [CHAR LIMIT=50] --> + <string name="transparent_navigation_bar">Transparent navigation bar</string> + <!-- UI debug setting: make navigation bar background color transparent by default summary [CHAR LIMIT=100] --> + <string name="transparent_navigation_bar_summary">Make navigation bar background color transparent by default</string> + <!-- UI debug setting: enable or disable window blurs [CHAR LIMIT=50] --> <string name="window_blurs">Allow window-level blurs</string> diff --git a/packages/overlays/Android.mk b/packages/overlays/Android.mk index 69641e69a9f2..cbca3f03fb0f 100644 --- a/packages/overlays/Android.mk +++ b/packages/overlays/Android.mk @@ -31,6 +31,7 @@ LOCAL_REQUIRED_MODULES := \ NavigationBarModeGesturalOverlayNarrowBack \ NavigationBarModeGesturalOverlayWideBack \ NavigationBarModeGesturalOverlayExtraWideBack \ + TransparentNavigationBarOverlay \ preinstalled-packages-platform-overlays.xml include $(BUILD_PHONY_PACKAGE) diff --git a/packages/overlays/TransparentNavigationBarOverlay/Android.bp b/packages/overlays/TransparentNavigationBarOverlay/Android.bp new file mode 100644 index 000000000000..43dc82b6c17d --- /dev/null +++ b/packages/overlays/TransparentNavigationBarOverlay/Android.bp @@ -0,0 +1,30 @@ +// +// Copyright 2023, The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + +runtime_resource_overlay { + name: "TransparentNavigationBarOverlay", + theme: "TransparentNavigationBar", + product_specific: true, +} diff --git a/packages/overlays/TransparentNavigationBarOverlay/AndroidManifest.xml b/packages/overlays/TransparentNavigationBarOverlay/AndroidManifest.xml new file mode 100644 index 000000000000..d69abfa2ed29 --- /dev/null +++ b/packages/overlays/TransparentNavigationBarOverlay/AndroidManifest.xml @@ -0,0 +1,26 @@ +<!-- +/** + * Copyright (c) 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.internal.systemui.navbar.transparent" + android:versionCode="1" + android:versionName="1.0"> + <overlay android:targetPackage="android" + android:priority="1"/> + + <application android:label="@string/transparent_navigation_bar_title" android:hasCode="false"/> +</manifest>
\ No newline at end of file diff --git a/packages/overlays/TransparentNavigationBarOverlay/res/values/config.xml b/packages/overlays/TransparentNavigationBarOverlay/res/values/config.xml new file mode 100644 index 000000000000..3b358ea32125 --- /dev/null +++ b/packages/overlays/TransparentNavigationBarOverlay/res/values/config.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<resources> + <!-- Controls whether the navigation bar background color provided by the app is transparent by + default. This should be controlled in developer options. --> + <bool name="config_navBarDefaultTransparent">true</bool> +</resources>
\ No newline at end of file diff --git a/packages/overlays/TransparentNavigationBarOverlay/res/values/strings.xml b/packages/overlays/TransparentNavigationBarOverlay/res/values/strings.xml new file mode 100644 index 000000000000..0e3462e2bbb0 --- /dev/null +++ b/packages/overlays/TransparentNavigationBarOverlay/res/values/strings.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Name of overlay [CHAR LIMIT=64] --> + <string name="transparent_navigation_bar_title" translatable="false">Transparent navigation bar</string> +</resources>
\ No newline at end of file |