<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 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.
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/preview_linear_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/preview_layout_container"
    android:backgroundTint="@color/widgetBackground"
    android:padding="12dp">

    <RelativeLayout
        android:id="@+id/titleBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/users_icon"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:contentDescription="@string/preview_users_icon_content_description"
            android:src="@drawable/users_icon"
            android:tint="@color/primary" />

        <TextView
            android:id="@+id/widget_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="8dp"
            android:layout_toEndOf="@id/users_icon"
            android:text="@string/multiuser_widget_title"
            android:textColor="@color/onSurface"
            android:textSize="16sp" />

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:adjustViewBounds="true"
            android:background="@drawable/preview_button_shape"
            android:backgroundTint="@color/secondaryContainer"
            android:clipToOutline="true">

            <ImageView
                android:id="@+id/settings_icon"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_centerVertical="true"
                android:layout_marginHorizontal="12dp"
                android:layout_marginVertical="4dp"
                android:contentDescription="@string/preview_settings_icon_content_description"
                android:src="@drawable/settings"
                android:tint="@color/onSecondaryContainer" />
        </RelativeLayout>
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:gravity="center_vertical"
        android:layout_weight="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="16dp"
            android:baselineAligned="false">

            <LinearLayout
                android:id="@+id/user_layout"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical"
                android:gravity="center"
                android:layout_marginEnd="16dp">

                <ImageView
                    android:id="@+id/first_image"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:adjustViewBounds="true"
                    android:contentDescription="@string/preview_first_avatar_content_description"
                    android:scaleType="fitCenter"
                    android:src="@drawable/preview_user_avatar_2" />

                <TextView
                    android:id="@+id/first_user_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:text="@string/preview_first_user_name"
                    android:textColor="@color/onSecondaryContainer"
                    android:textSize="16sp" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/buttons_layout"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <RelativeLayout
                    android:id="@+id/switchIconButton"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_marginBottom="4dp"
                    android:layout_weight="1"
                    android:gravity="bottom">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:adjustViewBounds="true"
                        android:background="@drawable/preview_button_shape"
                        android:backgroundTint="@color/primary"
                        android:clipToOutline="true"
                        android:maxHeight="40dp"
                        android:maxWidth="80dp"
                        android:minHeight="20dp"
                        android:minWidth="20dp">

                        <ImageView
                            android:id="@+id/switchIcon"
                            android:layout_width="24dp"
                            android:layout_height="24dp"
                            android:layout_centerInParent="true"
                            android:layout_marginVertical="12dp"
                            android:contentDescription="@string/switch_user_button_content_description"
                            android:src="@drawable/switch_arrows_24"
                            android:tint="@color/onPrimary" />
                    </RelativeLayout>
                </RelativeLayout>

                <RelativeLayout
                    android:id="@+id/addUserButton"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_marginTop="4dp"
                    android:layout_weight="1"
                    android:gravity="top">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:adjustViewBounds="true"
                        android:background="@drawable/preview_button_shape"
                        android:backgroundTint="@color/secondaryContainer"
                        android:clipToOutline="true"
                        android:maxHeight="40dp"
                        android:maxWidth="80dp"
                        android:minHeight="20dp"
                        android:minWidth="20dp">

                        <ImageView
                            android:id="@+id/addUser"
                            android:layout_width="24dp"
                            android:layout_height="24dp"
                            android:layout_centerInParent="true"
                            android:layout_marginVertical="12dp"
                            android:contentDescription="@string/add_user_button_content_description"
                            android:src="@drawable/add_24"
                            android:tint="@color/onSecondaryContainer" />
                    </RelativeLayout>
                </RelativeLayout>
            </LinearLayout>
        </LinearLayout>
    </RelativeLayout>
</LinearLayout>
