diff options
20 files changed, 267 insertions, 86 deletions
diff --git a/packages/SystemUI/res/color/kg_user_switcher_rounded_background_color.xml b/packages/SystemUI/res/color/kg_user_switcher_rounded_background_color.xml new file mode 100644 index 000000000000..b16d038f68f2 --- /dev/null +++ b/packages/SystemUI/res/color/kg_user_switcher_rounded_background_color.xml @@ -0,0 +1,22 @@ +<?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 + --> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_activated="true" android:color="@color/kg_user_switcher_activated_background_color" /> + <item android:color="@android:color/transparent" /> +</selector>
\ No newline at end of file diff --git a/packages/SystemUI/res/color/qs_user_detail_avatar_frame.xml b/packages/SystemUI/res/color/qs_user_avatar_frame.xml index 344859c27e34..0c816b4feffc 100644 --- a/packages/SystemUI/res/color/qs_user_detail_avatar_frame.xml +++ b/packages/SystemUI/res/color/qs_user_avatar_frame.xml @@ -18,5 +18,5 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" android:color="?android:attr/colorAccent" /> - <item android:color="@android:color/transparent" /> + <item android:color="@color/qs_user_switcher_avatar_background" /> </selector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/bg_avatar_selected.xml b/packages/SystemUI/res/drawable/bg_avatar_selected.xml new file mode 100644 index 000000000000..84d3416b7885 --- /dev/null +++ b/packages/SystemUI/res/drawable/bg_avatar_selected.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 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. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportWidth="100" + android:viewportHeight="100"> + + <path + android:fillColor="?android:attr/colorAccent" + android:pathData="M50,50m-50,0a50,50 0,1 1,100 0a50,50 0,1 1,-100 0"/> + +</vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/ic_add_circle.xml b/packages/SystemUI/res/drawable/ic_add_circle.xml new file mode 100644 index 000000000000..79ea70704ec9 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_add_circle.xml @@ -0,0 +1,27 @@ +<!-- + ~ Copyright (C) 2020 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. + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportWidth="48" + android:viewportHeight="48"> + + <path + android:pathData="M23.9998,10.667C16.6398,10.667 10.6665,16.6403 10.6665,24.0003C10.6665,31.3603 16.6398,37.3337 23.9998,37.3337C31.3598,37.3337 37.3332,31.3603 37.3332,24.0003C37.3332,16.6403 31.3598,10.667 23.9998,10.667ZM22.6665,17.3337V22.667H17.3332V25.3337H22.6665V30.667H25.3332V25.3337H30.6665V22.667H25.3332V17.3337H22.6665ZM13.3332,24.0003C13.3332,29.8803 18.1198,34.667 23.9998,34.667C29.8798,34.667 34.6665,29.8803 34.6665,24.0003C34.6665,18.1203 29.8798,13.3337 23.9998,13.3337C18.1198,13.3337 13.3332,18.1203 13.3332,24.0003Z" + android:fillColor="#ffffff" + android:fillType="evenOdd"/> + +</vector> diff --git a/packages/SystemUI/res/drawable/ic_add_circle_qs.xml b/packages/SystemUI/res/drawable/ic_add_circle_qs.xml deleted file mode 100644 index 8e933445be0b..000000000000 --- a/packages/SystemUI/res/drawable/ic_add_circle_qs.xml +++ /dev/null @@ -1,31 +0,0 @@ -<!-- -Copyright (C) 2014 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. ---> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="48.0dp" - android:height="48.0dp" - android:viewportWidth="24.0" - android:viewportHeight="24.0" - android:tint="?android:attr/colorForeground"> - <group - android:scaleX="1.2" - android:scaleY="1.2" - android:pivotX="12.0" - android:pivotY="12.0"> - <path - android:fillColor="#FFFFFFFF" - android:pathData="M12.000000,2.000000C6.500000,2.000000 2.000000,6.500000 2.000000,12.000000s4.500000,10.000000 10.000000,10.000000c5.500000,0.000000 10.000000,-4.500000 10.000000,-10.000000S17.500000,2.000000 12.000000,2.000000zM17.000000,13.000000l-4.000000,0.000000l0.000000,4.000000l-2.000000,0.000000l0.000000,-4.000000L7.000000,13.000000l0.000000,-2.000000l4.000000,0.000000L11.000000,7.000000l2.000000,0.000000l0.000000,4.000000l4.000000,0.000000L17.000000,13.000000z"/> - </group> -</vector> diff --git a/packages/SystemUI/res/drawable/ic_avatar_guest_user.xml b/packages/SystemUI/res/drawable/ic_avatar_guest_user.xml new file mode 100644 index 000000000000..e3a83a29b764 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_avatar_guest_user.xml @@ -0,0 +1,27 @@ +<!-- + ~ Copyright (C) 2020 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. + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportWidth="48" + android:viewportHeight="48"> + + <path + android:pathData="M23.9998,10.667C16.6398,10.667 10.6665,16.6403 10.6665,24.0003C10.6665,31.3603 16.6398,37.3337 23.9998,37.3337C31.3598,37.3337 37.3332,31.3603 37.3332,24.0003C37.3332,16.6403 31.3598,10.667 23.9998,10.667ZM17.4265,32.3737C17.9998,31.1737 21.4932,30.0003 23.9998,30.0003C26.5065,30.0003 30.0132,31.1737 30.5732,32.3737C28.7598,33.8137 26.4798,34.667 23.9998,34.667C21.5198,34.667 19.2398,33.8137 17.4265,32.3737ZM23.9998,27.3337C25.9465,27.3337 30.5732,28.1203 32.4798,30.4403C33.8398,28.6537 34.6665,26.427 34.6665,24.0003C34.6665,18.1203 29.8798,13.3337 23.9998,13.3337C18.1198,13.3337 13.3332,18.1203 13.3332,24.0003C13.3332,26.427 14.1598,28.6537 15.5198,30.4403C17.4265,28.1203 22.0532,27.3337 23.9998,27.3337ZM23.9998,16.0003C21.4132,16.0003 19.3332,18.0803 19.3332,20.667C19.3332,23.2537 21.4132,25.3337 23.9998,25.3337C26.5865,25.3337 28.6665,23.2537 28.6665,20.667C28.6665,18.0803 26.5865,16.0003 23.9998,16.0003ZM21.9998,20.667C21.9998,21.7737 22.8932,22.667 23.9998,22.667C25.1065,22.667 25.9998,21.7737 25.9998,20.667C25.9998,19.5603 25.1065,18.667 23.9998,18.667C22.8932,18.667 21.9998,19.5603 21.9998,20.667Z" + android:fillColor="#ffffff" + android:fillType="evenOdd"/> + +</vector> diff --git a/packages/SystemUI/res/drawable/ic_avatar_user.xml b/packages/SystemUI/res/drawable/ic_avatar_user.xml new file mode 100644 index 000000000000..b4a4a88bf155 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_avatar_user.xml @@ -0,0 +1,27 @@ +<!-- + ~ Copyright (C) 2020 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. + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportWidth="48" + android:viewportHeight="48"> + + <path + android:pathData="M23.9998,10.667C16.6398,10.667 10.6665,16.6403 10.6665,24.0003C10.6665,31.3603 16.6398,37.3337 23.9998,37.3337C31.3598,37.3337 37.3332,31.3603 37.3332,24.0003C37.3332,16.6403 31.3598,10.667 23.9998,10.667ZM32.4798,30.4403C30.5732,28.1203 25.9465,27.3337 23.9998,27.3337C22.0532,27.3337 17.4265,28.1203 15.5198,30.4403C14.1598,28.6537 13.3332,26.427 13.3332,24.0003C13.3332,18.1203 18.1198,13.3337 23.9998,13.3337C29.8798,13.3337 34.6665,18.1203 34.6665,24.0003C34.6665,26.427 33.8398,28.6537 32.4798,30.4403ZM19.3332,20.667C19.3332,18.0803 21.4132,16.0003 23.9998,16.0003C26.5865,16.0003 28.6665,18.0803 28.6665,20.667C28.6665,23.2537 26.5865,25.3337 23.9998,25.3337C21.4132,25.3337 19.3332,23.2537 19.3332,20.667Z" + android:fillColor="#ffffff" + android:fillType="evenOdd"/> + +</vector> diff --git a/packages/SystemUI/res/drawable/rounded_user_switcher_bg.xml b/packages/SystemUI/res/drawable/kg_user_switcher_rounded_bg.xml index e3d010ee7674..13c5fe08f43a 100644 --- a/packages/SystemUI/res/drawable/rounded_user_switcher_bg.xml +++ b/packages/SystemUI/res/drawable/kg_user_switcher_rounded_bg.xml @@ -16,17 +16,17 @@ --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight"> - <item> - <shape> - <solid android:color="@color/qs_user_detail_avatar_frame" /> + <item> + <shape> + <solid android:color="@color/kg_user_switcher_rounded_background_color" /> - <padding - android:left="1dp" - android:right="1dp" - android:bottom="1dp" - android:top="1dp" /> + <padding + android:left="8dp" + android:right="8dp" + android:bottom="8dp" + android:top="8dp" /> - <corners android:radius="48dp" /> - </shape> - </item> + <corners android:radius="48dp" /> + </shape> + </item> </ripple> diff --git a/packages/SystemUI/res/drawable/qs_bg_avatar.xml b/packages/SystemUI/res/drawable/qs_bg_avatar.xml new file mode 100644 index 000000000000..41176a8efc5e --- /dev/null +++ b/packages/SystemUI/res/drawable/qs_bg_avatar.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 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. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportWidth="100" + android:viewportHeight="100"> + + <path + android:fillColor="@color/qs_user_switcher_avatar_background" + android:pathData="M50,50m-50,0a50,50 0,1 1,100 0a50,50 0,1 1,-100 0"/> + +</vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout-sw600dp/keyguard_user_switcher_item.xml b/packages/SystemUI/res/layout-sw600dp/keyguard_user_switcher_item.xml index 1f38b1ea1da5..4413b1ef3cd3 100644 --- a/packages/SystemUI/res/layout-sw600dp/keyguard_user_switcher_item.xml +++ b/packages/SystemUI/res/layout-sw600dp/keyguard_user_switcher_item.xml @@ -20,24 +20,24 @@ <com.android.systemui.statusbar.policy.KeyguardUserDetailItemView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sysui="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="8dp" - android:layout_marginEnd="8dp" + android:layout_marginEnd="32dp" android:gravity="end|center_vertical" android:clickable="true" - android:background="@drawable/rounded_user_switcher_bg" - sysui:regularTextAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher" - sysui:activatedTextAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher.Activated"> + android:background="@drawable/kg_user_switcher_rounded_bg" + sysui:regularTextAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher"> <TextView android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="13dp" + android:layout_marginStart="25dp" + android:layout_marginEnd="12dp" android:textAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher" /> <com.android.systemui.statusbar.phone.UserAvatarView android:id="@+id/user_picture" - android:layout_width="@dimen/framed_avatar_size" - android:layout_height="@dimen/framed_avatar_size" + android:layout_width="@dimen/kg_framed_avatar_size" + android:layout_height="@dimen/kg_framed_avatar_size" android:contentDescription="@null" sysui:badgeDiameter="18dp" sysui:badgeMargin="1dp" /> diff --git a/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml b/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml index b1e51659817e..626951c8c0b7 100644 --- a/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml +++ b/packages/SystemUI/res/layout/keyguard_user_switcher_item.xml @@ -36,8 +36,8 @@ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher" /> <com.android.systemui.statusbar.phone.UserAvatarView android:id="@+id/user_picture" - android:layout_width="@dimen/framed_avatar_size" - android:layout_height="@dimen/framed_avatar_size" + android:layout_width="@dimen/kg_framed_avatar_size" + android:layout_height="@dimen/kg_framed_avatar_size" android:contentDescription="@null" android:backgroundTint="@color/qs_user_detail_avatar_tint" android:backgroundTintMode="src_atop" @@ -45,5 +45,5 @@ sysui:framePadding="2.5dp" sysui:badgeDiameter="18dp" sysui:badgeMargin="1dp" - sysui:frameColor="@color/qs_user_detail_avatar_frame" /> + sysui:frameColor="@color/kg_user_switcher_rounded_background_color" /> </com.android.systemui.statusbar.policy.KeyguardUserDetailItemView> diff --git a/packages/SystemUI/res/layout/qs_user_detail_item.xml b/packages/SystemUI/res/layout/qs_user_detail_item.xml index 5c03e3099522..0608685c3440 100644 --- a/packages/SystemUI/res/layout/qs_user_detail_item.xml +++ b/packages/SystemUI/res/layout/qs_user_detail_item.xml @@ -30,21 +30,20 @@ android:clipToPadding="false" android:focusable="true" android:background="@drawable/ripple_drawable" - systemui:regularTextAppearance="@style/TextAppearance.QS.UserSwitcher" - systemui:activatedTextAppearance="@style/TextAppearance.QS.UserSwitcher.Activated"> + systemui:regularTextAppearance="@style/TextAppearance.QS.UserSwitcher"> <com.android.systemui.statusbar.phone.UserAvatarView android:id="@+id/user_picture" - android:layout_width="@dimen/framed_avatar_size" - android:layout_height="@dimen/framed_avatar_size" + android:layout_width="@dimen/qs_framed_avatar_size" + android:layout_height="@dimen/qs_framed_avatar_size" android:layout_marginBottom="7dp" android:backgroundTint="@color/qs_user_detail_avatar_tint" android:backgroundTintMode="src_atop" - systemui:frameWidth="2dp" - systemui:framePadding="2.5dp" + systemui:frameWidth="6dp" systemui:badgeDiameter="18dp" systemui:badgeMargin="1dp" - systemui:frameColor="@color/qs_user_detail_avatar_frame"/> + systemui:framePadding="-1dp" + systemui:frameColor="@color/qs_user_avatar_frame"/> <LinearLayout android:layout_width="wrap_content" diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml index 9b0fe465deee..93aa2701ad07 100644 --- a/packages/SystemUI/res/values-night/colors.xml +++ b/packages/SystemUI/res/values-night/colors.xml @@ -86,4 +86,15 @@ <color name="GM2_red_500">#E25142</color> <color name="GM2_yellow_500">#F5C518</color> + <!-- Icon color for user avatars in keyguard user switcher --> + <color name="kg_user_switcher_avatar_icon_color">@android:color/background_light</color> + <!-- Icon color for selected user avatars in keyguard user switcher --> + <color name="kg_user_switcher_selected_avatar_icon_color">#202124</color> + <!-- Icon color for user avatars in quick settings user switcher --> + <color name="qs_user_switcher_avatar_icon_color">@android:color/background_light</color> + <!-- Icon color for selected user avatars in quick settings user switcher --> + <color name="qs_user_switcher_selected_avatar_icon_color">#202124</color> + <!-- Color of background circle of user avatars in quick settings user switcher --> + <color name="qs_user_switcher_avatar_background">#3C4043</color> + </resources> diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index 89341838f3e3..8f73d231c732 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -45,6 +45,11 @@ <!-- Height of the status bar header bar when on Keyguard --> <dimen name="status_bar_header_height_keyguard">60dp</dimen> + <!-- Size of user icon + frame in the qs user picker (incl. frame) --> + <dimen name="qs_framed_avatar_size">60dp</dimen> + <!-- Size of user icon + frame in the keyguard user picker (incl. frame) --> + <dimen name="kg_framed_avatar_size">48dp</dimen> + <!-- The width of user avatar when on Keyguard --> <dimen name="multi_user_switch_width_keyguard">48dp</dimen> @@ -88,4 +93,7 @@ <!-- Keyboard shortcuts helper --> <dimen name="ksh_layout_width">488dp</dimen> + + <!-- Text size for user name in user switcher --> + <dimen name="kg_user_switcher_text_size">18sp</dimen> </resources> diff --git a/packages/SystemUI/res/values-sw600dp/styles.xml b/packages/SystemUI/res/values-sw600dp/styles.xml index b375364fdab9..02bd60210e81 100644 --- a/packages/SystemUI/res/values-sw600dp/styles.xml +++ b/packages/SystemUI/res/values-sw600dp/styles.xml @@ -30,20 +30,10 @@ <item name="android:textColor">?attr/wallpaperTextColor</item> </style> - <style name="TextAppearance.StatusBar.Expanded.UserSwitcher.Activated"> - <item name="android:fontWeight">700</item> - <item name="android:textStyle">bold</item> - <item name="android:textColor">?android:attr/textColorPrimaryInverse</item> - </style> - <style name="TextAppearance.QS.UserSwitcher"> - <item name="android:textSize">@dimen/qs_detail_item_primary_text_size</item> + <item name="android:textSize">@dimen/kg_user_switcher_text_size</item> <item name="android:textColor">?android:attr/textColorSecondary</item> <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item> </style> - <style name="TextAppearance.QS.UserSwitcher.Activated"> - <item name="android:fontWeight">700</item> - <item name="android:textStyle">bold</item> - </style> </resources> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 74bbee681ccc..288487acec79 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -58,6 +58,19 @@ <!-- Shadows under the clock, date and other keyguard text fields --> <color name="keyguard_shadow_color">#B2000000</color> + <!-- Color for rounded background for activated user in keyguard user switcher --> + <color name="kg_user_switcher_activated_background_color">#26000000</color> + <!-- Icon color for user avatars in keyguard user switcher --> + <color name="kg_user_switcher_avatar_icon_color">@android:color/background_light</color> + <!-- Icon color for selected user avatars in keyguard user switcher --> + <color name="kg_user_switcher_selected_avatar_icon_color">@android:color/background_light</color> + <!-- Icon color for user avatars in user switcher quick settings --> + <color name="qs_user_switcher_avatar_icon_color">#3C4043</color> + <!-- Icon color for selected user avatars in user switcher quick settings --> + <color name="qs_user_switcher_selected_avatar_icon_color">@android:color/background_light</color> + <!-- Color of background circle of user avatars in quick settings --> + <color name="qs_user_switcher_avatar_background">#DADCE0</color> + <!-- The color of the legacy notification background --> <color name="notification_legacy_background_color">#ff1a1a1a</color> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 23be78bd6a77..63cff9591f85 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -751,8 +751,10 @@ quick settings header --> <dimen name="max_avatar_size">48dp</dimen> - <!-- Size of user icon + frame in the qs/keyguard user picker (incl. frame) --> - <dimen name="framed_avatar_size">54dp</dimen> + <!-- Size of user icon + frame in the qs user picker (incl. frame) --> + <dimen name="qs_framed_avatar_size">54dp</dimen> + <!-- Size of user icon + frame in the keyguard user picker (incl. frame) --> + <dimen name="kg_framed_avatar_size">54dp</dimen> <!-- Margin on the left side of the carrier text on Keyguard --> <dimen name="keyguard_carrier_text_margin">16dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java index 4f9052709870..447f48b5db94 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java @@ -18,6 +18,8 @@ package com.android.systemui.qs.tiles; import android.content.Context; import android.content.Intent; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.LayerDrawable; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; @@ -29,6 +31,7 @@ import com.android.settingslib.RestrictedLockUtils; import com.android.systemui.R; import com.android.systemui.qs.PseudoGridView; import com.android.systemui.statusbar.policy.UserSwitcherController; + /** * Quick settings detail view for user switching. */ @@ -101,6 +104,19 @@ public class UserDetailView extends PseudoGridView { return v; } + private static Drawable getDrawable(Context context, + UserSwitcherController.UserRecord item) { + Drawable icon = getIconDrawable(context, item); + int iconColorRes = item.isCurrent ? R.color.qs_user_switcher_selected_avatar_icon_color + : R.color.qs_user_switcher_avatar_icon_color; + icon.setTint(context.getResources().getColor(iconColorRes, context.getTheme())); + + int bgRes = item.isCurrent ? R.drawable.bg_avatar_selected : R.drawable.qs_bg_avatar; + Drawable bg = context.getDrawable(bgRes); + LayerDrawable drawable = new LayerDrawable(new Drawable[]{bg, icon}); + return drawable; + } + @Override public void onClick(View view) { UserSwitcherController.UserRecord tag = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java index 7d5498157136..45e47f1f763f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java @@ -21,6 +21,8 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.content.Context; import android.database.DataSetObserver; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.LayerDrawable; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -294,6 +296,21 @@ public class KeyguardUserSwitcher { return convertView; } + private static Drawable getDrawable(Context context, + UserSwitcherController.UserRecord item) { + Drawable drawable = getIconDrawable(context, item); + int iconColorRes = item.isCurrent ? R.color.kg_user_switcher_selected_avatar_icon_color + : R.color.kg_user_switcher_avatar_icon_color; + drawable.setTint(context.getResources().getColor(iconColorRes, context.getTheme())); + + if (item.isCurrent) { + Drawable bg = context.getDrawable(R.drawable.bg_avatar_selected); + drawable = new LayerDrawable(new Drawable[]{bg, drawable}); + } + + return drawable; + } + @Override public void onClick(View v) { UserSwitcherController.UserRecord user = (UserSwitcherController.UserRecord) v.getTag(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java index 69eaaa4f54a9..bb0b5e00ff67 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -31,7 +31,6 @@ import android.content.IntentFilter; import android.content.pm.UserInfo; import android.database.ContentObserver; import android.graphics.Bitmap; -import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Handler; @@ -52,7 +51,6 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.util.UserIcons; import com.android.settingslib.RestrictedLockUtilsInternal; -import com.android.settingslib.Utils; import com.android.systemui.Dumpable; import com.android.systemui.GuestResumeSessionReceiver; import com.android.systemui.Prefs; @@ -684,18 +682,17 @@ public class UserSwitcherController implements Dumpable { } } - public Drawable getDrawable(Context context, UserRecord item) { + protected static Drawable getIconDrawable(Context context, UserRecord item) { + int iconRes; if (item.isAddUser) { - return context.getDrawable(R.drawable.ic_add_circle_qs); - } - Drawable icon = UserIcons.getDefaultUserIcon( - context.getResources(), item.resolveId(), /* light= */ false); - if (item.isGuest) { - icon.setColorFilter(Utils.getColorAttrDefaultColor(context, - android.R.attr.colorForeground), - Mode.SRC_IN); + iconRes = R.drawable.ic_add_circle; + } else if (item.isGuest) { + iconRes = R.drawable.ic_avatar_guest_user; + } else { + iconRes = R.drawable.ic_avatar_user; } - return icon; + + return context.getDrawable(iconRes); } public void refresh() { |