diff options
author | Brad Stenning <stenning@google.com> | 2018-05-11 13:14:57 -0700 |
---|---|---|
committer | Brad Stenning <stenning@google.com> | 2018-05-11 13:14:57 -0700 |
commit | e38a2fc3ca8570eb7db0eb76e9a64f4adefbc3f5 (patch) | |
tree | d938bfef7c0932e32511147588bfd0328ddf5cce /car_product | |
parent | 2538693d099f9a849a239c03df92cbaf3410f592 (diff) | |
download | Car-e38a2fc3ca8570eb7db0eb76e9a64f4adefbc3f5.tar.gz |
Add a car product nav bar to give AOSP builds a more useful nav bar and
a demo showing how to change the nav bar for while the lock screen is up
Fixes:78584997
Fixes:74446022
Test: lunch aosp_car_x86_64 emulator, build and emulator -skin 1024x768 -selinux permissive
Change-Id: I04adc0380ebbb1f31c397fa10ecd0ed9767d88b2
Diffstat (limited to 'car_product')
-rw-r--r-- | car_product/overlay/frameworks/base/packages/SystemUI/res/layout/car_navigation_bar.xml | 165 | ||||
-rw-r--r-- | car_product/overlay/frameworks/base/packages/SystemUI/res/values/styles.xml | 7 |
2 files changed, 172 insertions, 0 deletions
diff --git a/car_product/overlay/frameworks/base/packages/SystemUI/res/layout/car_navigation_bar.xml b/car_product/overlay/frameworks/base/packages/SystemUI/res/layout/car_navigation_bar.xml new file mode 100644 index 0000000000..a4902cdf6e --- /dev/null +++ b/car_product/overlay/frameworks/base/packages/SystemUI/res/layout/car_navigation_bar.xml @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 2018, 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. +*/ +--> + +<com.android.systemui.statusbar.car.CarNavigationBarView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:systemui="http://schemas.android.com/apk/res-auto" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:background="@drawable/system_bar_background"> + + <LinearLayout + android:layout_height="match_parent" + android:layout_width="wrap_content" + android:paddingStart="@dimen/car_keyline_1" + android:paddingEnd="@dimen/car_keyline_1" + android:orientation="horizontal" + android:id="@+id/nav_buttons" + android:gravity="center" + android:layout_weight="1" + android:animateLayoutChanges="true"> + + <com.android.systemui.statusbar.car.CarNavigationButton + android:id="@+id/home" + style="@style/NavigationBarButton" + systemui:intent="intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.HOME;launchFlags=0x14000000;end" + android:src="@drawable/car_ic_overview" + android:background="?android:attr/selectableItemBackground" + /> + + <com.android.systemui.statusbar.car.CarFacetButton + android:id="@+id/maps_nav" + style="@style/NavigationBarButton" + systemui:icon="@drawable/car_ic_navigation" + systemui:intent="intent:#Intent;component=com.android.car.mapsplaceholder/.MapsPlaceholderActivity;launchFlags=0x24000000;end" + systemui:componentNames="com.android.car.mapsplaceholder/.MapsPlaceholderActivity" + /> + + <com.android.systemui.statusbar.car.CarFacetButton + android:id="@+id/music_nav" + style="@style/NavigationBarButton" + systemui:icon="@drawable/car_ic_music" + systemui:intent="intent:#Intent;component=com.android.car.media/.MediaActivity;launchFlags=0x14000000;end" + systemui:packages="com.android.car.media" + /> + + <com.android.systemui.statusbar.car.CarFacetButton + android:id="@+id/phone_nav" + style="@style/NavigationBarButton" + systemui:icon="@drawable/car_ic_phone" + systemui:intent="intent:#Intent;component=com.android.car.dialer/.TelecomActivity;launchFlags=0x14000000;end" + systemui:componentNames="com.android.car.dialer/.TelecomActivity" + /> + + <com.android.systemui.statusbar.car.CarFacetButton + android:id="@+id/grid_nav" + style="@style/NavigationBarButton" + systemui:icon="@drawable/car_ic_apps" + systemui:intent="intent:#Intent;component=com.android.car.carlauncher/.AppGridActivity;launchFlags=0x24000000;end" + systemui:componentNames="com.android.car.carlauncher/.AppGridActivity" + /> + + <Space + android:layout_height="match_parent" + android:layout_width="0dp" + android:layout_weight="1"/> + + <com.android.systemui.statusbar.car.CarNavigationButton + android:id="@+id/hvac" + style="@style/NavigationBarButton" + systemui:intent="intent:#Intent;action=android.car.intent.action.TOGGLE_HVAC_CONTROLS;end" + systemui:broadcast="true" + android:src="@drawable/car_ic_hvac" + android:background="?android:attr/selectableItemBackground" + /> + + <com.android.keyguard.AlphaOptimizedImageButton + android:id="@+id/notifications" + style="@style/NavigationBarButton" + android:src="@drawable/car_ic_notification" + android:background="?android:attr/selectableItemBackground" + /> + + <FrameLayout + android:id="@+id/clock_container" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_centerInParent="true" + > + <com.android.systemui.statusbar.car.CarNavigationButton + android:id="@+id/qs" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:background="@null" + systemui:intent="intent:#Intent;component=com.android.car.settings/.common.CarSettingActivity;launchFlags=0x14008000;end" + /> + <com.android.systemui.statusbar.policy.Clock + android:id="@+id/clock" + android:textAppearance="@style/TextAppearance.StatusBar.Clock" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:singleLine="true" + android:paddingStart="@dimen/status_bar_clock_starting_padding" + android:paddingEnd="@dimen/status_bar_clock_end_padding" + android:gravity="center_vertical" + /> + </FrameLayout> + </LinearLayout> + + <LinearLayout + android:layout_height="match_parent" + android:layout_width="wrap_content" + android:gravity="center" + android:paddingStart="@dimen/car_keyline_1" + android:paddingEnd="@dimen/car_keyline_1" + android:id="@+id/lock_screen_nav_buttons" + android:layout_weight="1" + android:visibility="gone"> + + <Space + android:layout_height="match_parent" + android:layout_width="0dp" + android:layout_weight="1"/> + + <com.android.systemui.statusbar.car.CarNavigationButton + android:id="@+id/hvac_lockscreen" + style="@style/NavigationBarButton" + systemui:intent="intent:#Intent;action=android.car.intent.action.TOGGLE_HVAC_CONTROLS;end" + systemui:broadcast="true" + android:src="@drawable/car_ic_hvac" + android:background="?android:attr/selectableItemBackground" + /> + + <Space + style="@style/NavigationBarButton"/> + + <com.android.systemui.statusbar.policy.Clock + android:id="@+id/clock_lockscreen" + android:textAppearance="@style/TextAppearance.StatusBar.Clock" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:singleLine="true" + android:paddingStart="@dimen/status_bar_clock_starting_padding" + android:paddingEnd="@dimen/status_bar_clock_end_padding" + android:gravity="center_vertical" + /> + </LinearLayout> + +</com.android.systemui.statusbar.car.CarNavigationBarView> + diff --git a/car_product/overlay/frameworks/base/packages/SystemUI/res/values/styles.xml b/car_product/overlay/frameworks/base/packages/SystemUI/res/values/styles.xml index 1fc3503f81..68fc641d1d 100644 --- a/car_product/overlay/frameworks/base/packages/SystemUI/res/values/styles.xml +++ b/car_product/overlay/frameworks/base/packages/SystemUI/res/values/styles.xml @@ -27,4 +27,11 @@ <item name="android:padding">22dp</item> </style> + <style name="NavigationBarButton"> + <item name="android:layout_height">56dp</item> + <item name="android:layout_width">76dp</item> + <item name="android:paddingStart">@dimen/car_padding_1</item> + <item name="android:paddingEnd">@dimen/car_padding_1</item> + </style> + </resources> |