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<LinearLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    xmlns:app="http://schemas.android.com/apk/res-auto"
21    android:id="@+id/modes_set_schedule_layout"
22    android:layout_width="match_parent"
23    android:layout_height="wrap_content"
24    android:layout_centerHorizontal="true"
25    android:gravity="fill_horizontal"
26    android:orientation="vertical"
27    android:paddingLeft="24dp"
28    android:paddingRight="24dp"
29    android:paddingTop="24dp"
30    android:paddingBottom="24dp">
31
32    <!-- Start time & end time row -->
33    <LinearLayout
34        android:layout_width="match_parent"
35        android:layout_height="wrap_content"
36        android:gravity="fill_horizontal"
37        android:orientation="horizontal">
38
39        <!-- Start time: title (non-clickable preference), time setter -->
40        <LinearLayout
41            android:layout_width="0dp"
42            android:layout_height="wrap_content"
43            android:layout_weight="1"
44            android:orientation="vertical">
45
46            <TextView
47                android:id="@+id/start_time_label"
48                android:clickable="false"
49                android:layout_width="wrap_content"
50                android:layout_height="wrap_content"
51                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Medium"
52                android:text="@string/zen_mode_start_time" />
53
54            <TextView
55                android:id="@+id/start_time"
56                android:layout_width="wrap_content"
57                android:layout_height="wrap_content"
58                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Title"
59                android:textColor="?android:attr/colorAccent"
60                android:textSize="40sp" />
61
62        </LinearLayout>
63
64        <!-- End time: title (non-clickable preference), time setter -->
65        <LinearLayout
66            android:layout_width="0dp"
67            android:layout_height="wrap_content"
68            android:layout_weight="1"
69            android:orientation="vertical">
70
71            <TextView
72                android:id="@+id/end_time_label"
73                android:clickable="false"
74                android:layout_width="wrap_content"
75                android:layout_height="wrap_content"
76                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Medium"
77                android:text="@string/zen_mode_end_time" />
78
79            <TextView
80                android:id="@+id/end_time"
81                android:layout_width="wrap_content"
82                android:layout_height="wrap_content"
83                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Title"
84                android:textColor="?android:attr/colorAccent"
85                android:textSize="40sp" />
86
87        </LinearLayout>
88
89    </LinearLayout>
90
91    <!-- Schedule duration display row -->
92    <LinearLayout
93        android:layout_width="match_parent"
94        android:layout_height="wrap_content"
95        android:orientation="horizontal"
96        android:paddingTop="8dp"
97        android:paddingBottom="8dp">
98
99        <!-- left side line divider -->
100        <View
101            android:layout_width="0dp"
102            android:layout_height="1.5dp"
103            android:layout_weight="1"
104            android:layout_gravity="center_vertical"
105            android:background="?android:attr/dividerHorizontal" />
106
107        <!-- length of schedule -->
108        <TextView
109            android:id="@+id/schedule_duration"
110            android:clickable="false"
111            android:layout_width="wrap_content"
112            android:layout_height="wrap_content"
113            android:paddingHorizontal="8dp"
114            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Small" />
115
116        <!-- right side line divider -->
117        <View
118            android:layout_width="0dp"
119            android:layout_height="1.5dp"
120            android:layout_weight="1"
121            android:layout_gravity="center_vertical"
122            android:background="?android:attr/dividerHorizontal" />
123
124    </LinearLayout>
125
126    <!-- Buttons for selecting days of the week -->
127    <androidx.constraintlayout.widget.ConstraintLayout
128        android:id="@+id/days_of_week_container"
129        android:layout_width="match_parent"
130        android:layout_height="wrap_content"
131        android:minHeight="10dp"
132        android:maxHeight="60dp"
133        android:orientation="horizontal">
134
135        <ToggleButton
136            android:id="@+id/day0"
137            android:layout_width="0dp"
138            android:layout_height="0dp"
139            android:background="@drawable/modes_schedule_day_toggle"
140            android:textColor="@color/modes_set_schedule_text_color"
141            android:textSize="18sp"
142            app:layout_constraintDimensionRatio="1:1"
143            app:layout_constraintHorizontal_chainStyle="spread_inside"
144            app:layout_constraintEnd_toStartOf="@+id/day1"
145            app:layout_constraintStart_toStartOf="parent"
146            app:layout_constraintTop_toTopOf="parent" />
147
148        <ToggleButton
149            android:id="@+id/day1"
150            android:layout_width="0dp"
151            android:layout_height="0dp"
152            android:background="@drawable/modes_schedule_day_toggle"
153            android:textColor="@color/modes_set_schedule_text_color"
154            android:textSize="18sp"
155            app:layout_constraintDimensionRatio="1:1"
156            app:layout_constraintHorizontal_chainStyle="spread_inside"
157            app:layout_constraintStart_toEndOf="@+id/day0"
158            app:layout_constraintEnd_toStartOf="@+id/day2"
159            app:layout_constraintTop_toTopOf="parent" />
160
161        <ToggleButton
162            android:id="@+id/day2"
163            android:layout_width="0dp"
164            android:layout_height="0dp"
165            android:background="@drawable/modes_schedule_day_toggle"
166            android:textColor="@color/modes_set_schedule_text_color"
167            android:textSize="18sp"
168            app:layout_constraintDimensionRatio="1:1"
169            app:layout_constraintHorizontal_chainStyle="spread_inside"
170            app:layout_constraintStart_toEndOf="@+id/day1"
171            app:layout_constraintEnd_toStartOf="@+id/day3"
172            app:layout_constraintTop_toTopOf="parent" />
173
174        <ToggleButton
175            android:id="@+id/day3"
176            android:layout_width="0dp"
177            android:layout_height="0dp"
178            android:background="@drawable/modes_schedule_day_toggle"
179            android:textColor="@color/modes_set_schedule_text_color"
180            android:textSize="18sp"
181            app:layout_constraintDimensionRatio="1:1"
182            app:layout_constraintHorizontal_chainStyle="spread_inside"
183            app:layout_constraintStart_toEndOf="@+id/day2"
184            app:layout_constraintEnd_toStartOf="@+id/day4"
185            app:layout_constraintTop_toTopOf="parent" />
186
187        <ToggleButton
188            android:id="@+id/day4"
189            android:layout_width="0dp"
190            android:layout_height="0dp"
191            android:background="@drawable/modes_schedule_day_toggle"
192            android:textColor="@color/modes_set_schedule_text_color"
193            android:textSize="18sp"
194            app:layout_constraintDimensionRatio="1:1"
195            app:layout_constraintHorizontal_chainStyle="spread_inside"
196            app:layout_constraintStart_toEndOf="@+id/day3"
197            app:layout_constraintEnd_toStartOf="@+id/day5"
198            app:layout_constraintTop_toTopOf="parent" />
199
200        <ToggleButton
201            android:id="@+id/day5"
202            android:layout_width="0dp"
203            android:layout_height="0dp"
204            android:background="@drawable/modes_schedule_day_toggle"
205            android:textColor="@color/modes_set_schedule_text_color"
206            android:textSize="18sp"
207            app:layout_constraintDimensionRatio="1:1"
208            app:layout_constraintHorizontal_chainStyle="spread_inside"
209            app:layout_constraintStart_toEndOf="@+id/day4"
210            app:layout_constraintEnd_toStartOf="@+id/day6"
211            app:layout_constraintTop_toTopOf="parent" />
212
213        <ToggleButton
214            android:id="@+id/day6"
215            android:layout_width="0dp"
216            android:layout_height="0dp"
217            android:background="@drawable/modes_schedule_day_toggle"
218            android:textColor="@color/modes_set_schedule_text_color"
219            android:textSize="18sp"
220            app:layout_constraintDimensionRatio="1:1"
221            app:layout_constraintHorizontal_chainStyle="spread_inside"
222            app:layout_constraintEnd_toEndOf="parent"
223            app:layout_constraintStart_toEndOf="@+id/day5"
224            app:layout_constraintTop_toTopOf="parent" />
225
226    </androidx.constraintlayout.widget.ConstraintLayout>
227
228</LinearLayout>
229