diff options
| author | 2016-01-14 13:37:15 -0800 | |
|---|---|---|
| committer | 2016-01-20 18:47:03 -0800 | |
| commit | 4d5343ea3a4ffdb45c3af2af552a96fe60e21fef (patch) | |
| tree | 48ff1953bcb45e3a22072b6b3acf7ca34b89614c | |
| parent | bcd2b7179afb2028eb7402467de42c4a9a2b13cb (diff) | |
Commandeer full screen user switcher for auto.
The full screen user switcher wasn't needed by the original
author so adapt it for the auto use case because it fits
really well. This change adds in some legal text (TBR - legal)
and tweaks the layout a bit.
Bug: 26559008
Change-Id: Ib78d0ec8a8d4ec8411dbbffe5852c5307c2cf42f
| -rw-r--r-- | packages/SystemUI/res/layout/car_fullscreen_user_pod.xml (renamed from packages/SystemUI/res/layout/fullscreen_user_pod.xml) | 6 | ||||
| -rw-r--r-- | packages/SystemUI/res/layout/car_fullscreen_user_switcher.xml | 51 | ||||
| -rw-r--r-- | packages/SystemUI/res/layout/fullscreen_user_switcher.xml | 36 | ||||
| -rw-r--r-- | packages/SystemUI/res/layout/keyguard_user_switcher_item.xml | 2 | ||||
| -rw-r--r-- | packages/SystemUI/res/layout/super_status_bar.xml | 2 | ||||
| -rw-r--r-- | packages/SystemUI/res/values/dimens_car.xml | 32 | ||||
| -rw-r--r-- | packages/SystemUI/res/values/strings_car.xml | 29 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/UserGridView.java | 2 |
8 files changed, 118 insertions, 42 deletions
diff --git a/packages/SystemUI/res/layout/fullscreen_user_pod.xml b/packages/SystemUI/res/layout/car_fullscreen_user_pod.xml index 12f0a80e62c7..b7e666fbfbf9 100644 --- a/packages/SystemUI/res/layout/fullscreen_user_pod.xml +++ b/packages/SystemUI/res/layout/car_fullscreen_user_pod.xml @@ -26,13 +26,13 @@ <ImageView android:id="@+id/user_avatar" android:padding="10dp" android:layout_gravity="center" - android:layout_width="160dp" - android:layout_height="160dp" /> + android:layout_width="@dimen/car_fullscreen_user_pod_image_avatar_width" + android:layout_height="@dimen/car_fullscreen_user_pod_image_avatar_height" /> <TextView android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="@dimen/qs_detail_item_secondary_text_size" + android:textSize="@dimen/car_fullscreen_user_pod_text_size" android:textColor="@color/qs_user_detail_name" android:gravity="center_horizontal" /> </LinearLayout> diff --git a/packages/SystemUI/res/layout/car_fullscreen_user_switcher.xml b/packages/SystemUI/res/layout/car_fullscreen_user_switcher.xml new file mode 100644 index 000000000000..b953ff2c976a --- /dev/null +++ b/packages/SystemUI/res/layout/car_fullscreen_user_switcher.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2015 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. +--> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:fitsSystemWindows="true" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/car_lockscreen_disclaimer_title" + android:textSize="@dimen/car_lockscreen_disclaimer_title_size" + android:paddingStart="@dimen/car_lockscreen_disclaimer_title_padding_start" + android:paddingTop="@dimen/car_lockscreen_disclaimer_title_padding_top" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/car_lockscreen_disclaimer_text" + android:textSize="@dimen/car_lockscreen_disclaimer_text_size" + android:paddingStart="@dimen/car_lockscreen_disclaimer_text_padding_start" + android:paddingEnd="@dimen/car_lockscreen_disclaimer_text_padding_end" + android:paddingTop="@dimen/car_lockscreen_disclaimer_text_padding_top" /> + <com.android.systemui.statusbar.UserGridView + android:id="@+id/user_grid" + android:layout_gravity="center" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="@dimen/car_lockscreen_user_grid_view_padding_top" + android:stretchMode="columnWidth"> + </com.android.systemui.statusbar.UserGridView> + </LinearLayout> +</FrameLayout> diff --git a/packages/SystemUI/res/layout/fullscreen_user_switcher.xml b/packages/SystemUI/res/layout/fullscreen_user_switcher.xml deleted file mode 100644 index 46c18963cec1..000000000000 --- a/packages/SystemUI/res/layout/fullscreen_user_switcher.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2015 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. ---> - -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:fitsSystemWindows="true" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone"> - <com.android.systemui.statusbar.UserGridView - android:id="@+id/user_grid" - android:layout_gravity="center" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingStart="10dp" - android:paddingEnd="10dp" - android:columnWidth="180dp" - android:verticalSpacing="10dp" - android:horizontalSpacing="10dp" - android:stretchMode="columnWidth" - android:gravity="center"> - </com.android.systemui.statusbar.UserGridView> -</FrameLayout> diff --git a/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml b/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml index 2e673761995f..c6e453a5d991 100644 --- a/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml +++ b/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml @@ -43,4 +43,4 @@ sysui:frameWidth="@dimen/keyguard_user_switcher_border_thickness" sysui:framePadding="6dp" sysui:activeFrameColor="@color/current_user_border_color" /> -</com.android.systemui.qs.tiles.UserDetailItemView>
\ No newline at end of file +</com.android.systemui.qs.tiles.UserDetailItemView> diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml index 39da8d02a855..4c80b4843231 100644 --- a/packages/SystemUI/res/layout/super_status_bar.xml +++ b/packages/SystemUI/res/layout/super_status_bar.xml @@ -80,7 +80,7 @@ </FrameLayout> <ViewStub android:id="@+id/fullscreen_user_switcher_stub" - android:layout="@layout/fullscreen_user_switcher" + android:layout="@layout/car_fullscreen_user_switcher" android:layout_width="match_parent" android:layout_height="match_parent"/> diff --git a/packages/SystemUI/res/values/dimens_car.xml b/packages/SystemUI/res/values/dimens_car.xml new file mode 100644 index 000000000000..ecdccee003ee --- /dev/null +++ b/packages/SystemUI/res/values/dimens_car.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2016, 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> + <dimen name="car_lockscreen_disclaimer_title_size">48sp</dimen> + <dimen name="car_lockscreen_disclaimer_title_padding_start">96dp</dimen> + <dimen name="car_lockscreen_disclaimer_title_padding_top">96dp</dimen> + <dimen name="car_lockscreen_disclaimer_text_size">28sp</dimen> + <dimen name="car_lockscreen_disclaimer_text_padding_start">96dp</dimen> + <dimen name="car_lockscreen_disclaimer_text_padding_end">96dp</dimen> + <dimen name="car_lockscreen_disclaimer_text_padding_top">32dp</dimen> + <dimen name="car_lockscreen_user_grid_view_padding_start">10dp</dimen> + <dimen name="car_lockscreen_user_grid_view_padding_end">10dp</dimen> + <dimen name="car_lockscreen_user_grid_view_padding_top">128dp</dimen> + <dimen name="car_fullscreen_user_pod_image_avatar_width">128dp</dimen> + <dimen name="car_fullscreen_user_pod_image_avatar_height">128dp</dimen> + <dimen name="car_fullscreen_user_pod_text_size">24sp</dimen> +</resources> diff --git a/packages/SystemUI/res/values/strings_car.xml b/packages/SystemUI/res/values/strings_car.xml new file mode 100644 index 000000000000..882773a01bff --- /dev/null +++ b/packages/SystemUI/res/values/strings_car.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2016, 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> + <string name="car_lockscreen_disclaimer_title">Drive safely</string> + <string name="car_lockscreen_disclaimer_text"> + Stay fully aware of driving conditions and always obey applicable laws. Directions may be + inaccurate, incomplete, dangerous, not suitable, prohibited, or involve crossing + administrative areas. Business information may also be inaccurate or incomplete. Data is + not real-time, and location accuracy cannot be guaranteed. Do not handle your mobile device + or use apps not intended for Android Auto while driving. + </string> + +</resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/UserGridView.java b/packages/SystemUI/src/com/android/systemui/statusbar/UserGridView.java index 32caf9f0ecf7..2f8bc2d4cb0f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/UserGridView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/UserGridView.java @@ -137,7 +137,7 @@ public class UserGridView extends GridView { if (convertView == null) { LayoutInflater inflater = (LayoutInflater)getContext().getSystemService (Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.fullscreen_user_pod, null); + convertView = inflater.inflate(R.layout.car_fullscreen_user_pod, null); } UserSwitcherController.UserRecord record = getItem(position); |