• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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<RelativeLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    android:layout_width="wrap_content"
21    android:layout_height="wrap_content"
22    android:orientation="vertical"
23    android:padding="8dp"
24    android:background="@drawable/preview_layout_container">
25
26    <!-- Container for the icon and title in the upper-left corner -->
27    <RelativeLayout
28        android:layout_width="match_parent"
29        android:layout_height="wrap_content"
30        android:orientation="horizontal"
31        android:layout_alignParentTop="true"
32        android:layout_margin="8dp">
33
34        <ImageView
35            android:id="@+id/users_icon"
36            android:layout_width="24dp"
37            android:layout_height="24dp"
38            android:src="@drawable/users_icon"
39            android:tint="@color/onSurface"
40            android:contentDescription="@string/preview_users_icon_content_description"/>
41
42        <!-- Title -->
43        <TextView
44            android:id="@+id/widget_title"
45            android:layout_width="wrap_content"
46            android:layout_height="wrap_content"
47            android:layout_marginStart="8dp"
48            android:text="@string/multiuser_widget_title"
49            android:layout_toEndOf="@id/users_icon"
50            android:textSize="16sp"
51            android:textColor="@color/onSurface"/>
52
53
54        <ImageView
55            android:id="@+id/settings_icon"
56            android:layout_width="24dp"
57            android:layout_height="24dp"
58            android:src="@drawable/settings"
59            android:tint="@color/onSurface"
60            android:contentDescription="@string/preview_settings_icon_content_description"
61            android:layout_alignParentEnd="true"/>
62    </RelativeLayout>
63
64
65    <!-- Container for two side-by-side rounded images with titles -->
66    <LinearLayout
67        android:layout_width="match_parent"
68        android:layout_height="wrap_content"
69        android:layout_alignParentBottom="true"
70        android:orientation="horizontal"
71        android:gravity="center"
72        android:layout_below="@id/widget_title"
73        android:layout_centerHorizontal="true">
74
75        <!-- First image with a border and title in a vertical layout -->
76        <LinearLayout
77            android:layout_width="0dp"
78            android:layout_weight="1"
79            android:layout_height="wrap_content"
80            android:orientation="vertical"
81            android:gravity="center"
82            android:layout_marginEnd="16dp">
83
84            <!-- First rounded image with an outline -->
85            <ImageView
86                android:id="@+id/first_image"
87                style="@style/CircularImageViewStyle"
88                android:src="@drawable/preview_user_avatar_1"
89                android:background="@drawable/rounded_background"
90                android:contentDescription="@string/preview_first_avatar_content_description"/>
91
92            <!-- Title for the first image -->
93            <TextView
94                android:id="@+id/first_user_name"
95                android:layout_width="wrap_content"
96                android:layout_height="wrap_content"
97                android:layout_marginTop="8dp"
98                android:text="@string/preview_first_user_name"
99                android:textSize="14sp"
100                android:textColor="@color/onSurface"
101                android:gravity="center"/>
102        </LinearLayout>
103
104        <!-- Second image and title in a vertical layout -->
105        <LinearLayout
106            android:layout_width="0dp"
107            android:layout_height="match_parent"
108            android:layout_weight="1"
109            android:orientation="vertical"
110            android:gravity="center">
111
112            <!-- Second rounded image (without outline) -->
113            <ImageView
114                android:id="@+id/second_image"
115                style="@style/CircularImageViewStyle"
116                android:src="@drawable/preview_user_avatar_2"
117                android:contentDescription="@string/preview_second_avatar_content_description"/>
118
119            <!-- Title for the second image -->
120            <TextView
121                android:id="@+id/second_user_name"
122                android:layout_width="wrap_content"
123                android:layout_height="wrap_content"
124                android:layout_marginTop="8dp"
125                android:text="@string/preview_second_user_name"
126                android:textSize="14sp"
127                android:textColor="@color/onSurface"
128                android:gravity="center"/>
129        </LinearLayout>
130    </LinearLayout>
131
132</RelativeLayout>
133