1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2024 The Android Open Source Project 4 ~ 5 ~ Licensed under the Apache License, Version 2.0 (the "License"); 6 ~ you may not use this file except in compliance with the License. 7 ~ You may obtain a copy of the License at 8 ~ 9 ~ http://www.apache.org/licenses/LICENSE-2.0 10 ~ 11 ~ Unless required by applicable law or agreed to in writing, software 12 ~ distributed under the License is distributed on an "AS IS" BASIS, 13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ~ See the License for the specific language governing permissions and 15 ~ limitations under the License 16 --> 17 18<FrameLayout 19 xmlns:android="http://schemas.android.com/apk/res/android" 20 xmlns:systemui="http://schemas.android.com/apk/res-auto" 21 android:id="@+id/user_name_container" 22 android:layout_width="wrap_content" 23 android:layout_height="match_parent" 24 android:layout_centerVertical="true"> 25 <com.android.systemui.car.systembar.CarSystemBarPanelButtonView 26 android:id="@+id/user_name" 27 android:layout_width="wrap_content" 28 android:layout_height="@dimen/car_system_bar_user_name_button_height" 29 android:layout_marginEnd="@dimen/car_padding_2" 30 style="@style/TopBarButton" 31 android:layout_gravity="center_vertical" 32 systemui:controller="com.android.systemui.car.systembar.UserNamePanelButtonViewController" 33 systemui:panelLayoutRes="@layout/qc_profile_switcher" 34 systemui:panelWidthRes="@dimen/car_profile_quick_controls_panel_width" 35 systemui:gravity="top|end" 36 systemui:disabledWhileUnprovisioned="true" 37 systemui:disabledWhileDriving="@bool/config_profile_panel_disabled_while_driving" 38 systemui:systemBarDisable2Flags="quickSettings"> 39 <LinearLayout 40 android:layout_width="match_parent" 41 android:layout_height="match_parent" 42 android:orientation="horizontal" 43 android:layout_marginStart="@dimen/car_padding_2" 44 android:layout_marginEnd="@dimen/car_padding_2" 45 android:gravity="center_vertical"> 46 <ImageView 47 android:id="@+id/user_avatar" 48 android:layout_width="wrap_content" 49 android:layout_height="match_parent" 50 android:src="@drawable/car_ic_users_icon" 51 android:tint="@color/system_bar_icon_color_with_selection" 52 android:layout_marginEnd="@dimen/system_bar_user_icon_padding" 53 android:contentDescription="@string/system_bar_user_avatar" /> 54 <com.android.systemui.car.systembar.element.layout.CarSystemBarTextView 55 android:id="@+id/user_name_text" 56 android:layout_width="wrap_content" 57 android:layout_height="match_parent" 58 android:gravity="center_vertical" 59 style="@style/SystemBarUsernameText" 60 android:singleLine="true" 61 android:maxWidth="@dimen/car_system_bar_user_name_max_width" 62 android:layout_marginEnd="@dimen/system_bar_user_icon_padding" 63 android:contentDescription="@string/system_bar_user_name_text" 64 systemui:controller="com.android.systemui.car.systembar.UserNameTextViewController"/> 65 </LinearLayout> 66 </com.android.systemui.car.systembar.CarSystemBarPanelButtonView> 67</FrameLayout> 68