• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2008 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<LinearLayout
18    android:id="@+id/alarm_item"
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    xmlns:dc="http://schemas.android.com/apk/res-auto"
21    android:layout_width="match_parent"
22    android:layout_height="wrap_content"
23    android:paddingStart="@dimen/alarm_side_padding"
24    android:paddingEnd="@dimen/alarm_side_padding"
25    android:background="?android:attr/selectableItemBackground"
26    android:gravity="center_horizontal|top"
27    android:orientation="vertical">
28    <!-- TODO~: flatten this layout using gridLayout which supports layout_weight as of 21 -->
29
30    <LinearLayout
31        android:layout_width="match_parent"
32        android:layout_height="wrap_content"
33        android:layout_marginTop="@dimen/alarm_clock_vertical_margin"
34        android:orientation="horizontal">
35
36        <com.android.deskclock.widget.TextTime
37            android:id="@+id/digital_clock"
38            android:layout_width="wrap_content"
39            android:layout_height="wrap_content"
40            android:gravity="center"
41            android:textColor="@color/clock_white"
42            android:textSize="@dimen/alarm_time_font_size"
43            android:fontFamily="sans-serif-thin"
44            dc:format12Hour="@string/alarm_time_12_hours_format"
45            dc:format24Hour="@string/clock_24_hours_format" />
46
47        <Space
48            android:layout_width="0dip"
49            android:layout_height="wrap_content"
50            android:layout_weight="1" />
51
52        <Switch
53            android:id="@+id/onoff"
54            android:theme="@style/AlarmSwitchTheme"
55            android:layout_width="wrap_content"
56            android:layout_height="wrap_content"
57            android:layout_gravity="center_vertical|end" />
58    </LinearLayout>
59
60    <FrameLayout
61        android:layout_width="match_parent"
62        android:layout_height="wrap_content">
63
64        <LinearLayout
65            android:id="@+id/expand_area"
66            android:layout_width="match_parent"
67            android:layout_height="wrap_content"
68            android:layout_gravity="bottom"
69            android:layout_marginBottom="@dimen/collapse_expand_height"
70            android:orientation="vertical"
71            android:visibility="gone">
72
73            <CheckBox
74                android:id="@+id/repeat_onoff"
75                android:layout_width="wrap_content"
76                android:layout_height="48dip"
77                android:layout_gravity="center_vertical|start"
78                android:text="@string/alarm_repeat"
79                android:textSize="16sp"
80                android:paddingStart="12dip"
81                android:textColor="@color/clock_white" />
82
83            <LinearLayout
84                android:id="@+id/repeat_days"
85                android:layout_width="match_parent"
86                android:layout_height="48dip"
87                android:layout_gravity="top"
88                android:orientation="horizontal"
89                android:visibility="gone">
90                <!-- Day buttons are put here programatically -->
91            </LinearLayout>
92
93            <LinearLayout
94                android:layout_width="match_parent"
95                android:layout_height="wrap_content"
96                android:gravity="center_vertical"
97                android:orientation="horizontal" >
98
99                <TextView
100                    android:id="@+id/choose_ringtone"
101                    android:layout_width="0dip"
102                    android:layout_height="48dip"
103                    android:layout_weight="1"
104                    android:layout_alignParentStart="true"
105                    android:background="?android:attr/selectableItemBackground"
106                    android:clickable="true"
107                    android:paddingStart="4dip"
108                    android:drawablePadding="16dp"
109                    android:drawableStart="@drawable/ic_ringtone"
110                    android:ellipsize="marquee"
111                    android:gravity="center_vertical"
112                    android:marqueeRepeatLimit="marquee_forever"
113                    android:scrollHorizontally="true"
114                    android:singleLine="true"
115                    android:textAlignment="viewStart"
116                    android:textSize="16sp"
117                    android:textColor="@color/clock_white"
118                    />
119
120                <CheckBox
121                    android:id="@+id/vibrate_onoff"
122                    android:layout_width="wrap_content"
123                    android:layout_height="48dip"
124                    android:layout_alignParentEnd="true"
125                    android:layout_centerVertical="true"
126                    android:includeFontPadding="false"
127                    android:text="@string/alarm_vibrate"
128                    android:paddingStart="16dip"
129                    android:textSize="16sp"
130                    android:textColor="@color/white" />
131            </LinearLayout>
132
133            <TextView
134                android:id="@+id/edit_label"
135                android:layout_width="match_parent"
136                android:layout_height="wrap_content"
137                android:ellipsize="end"
138                android:hint="@string/label"
139                android:paddingBottom="12dp"
140                android:paddingEnd="12dp"
141                android:paddingLeft="18dp"
142                android:paddingRight="12dp"
143                android:paddingStart="18dp"
144                android:paddingTop="12dp"
145                android:singleLine="true"
146                android:textSize="16sp"
147                android:textColor="@color/white" />
148
149            <View
150                android:layout_width="match_parent"
151                android:layout_height="@dimen/hairline_height"
152                android:layout_marginLeft="12dip"
153                android:layout_marginRight="12dip"
154                android:background="@color/hairline" />
155
156        </LinearLayout>
157
158        <FrameLayout
159            android:id="@+id/collapse_expand"
160            android:layout_width="match_parent"
161            android:layout_height="wrap_content"
162            android:layout_gravity="bottom"
163            android:contentDescription="@string/collapse_alarm">
164
165            <ImageButton
166                android:id="@+id/delete"
167                android:layout_width="wrap_content"
168                android:layout_height="48dip"
169                android:layout_marginTop="@dimen/alarm_clock_vertical_margin"
170                android:layout_marginBottom="@dimen/alarm_clock_vertical_margin"
171                android:layout_marginStart="4dip"
172                android:layout_gravity="start"
173                android:background="?android:attr/selectableItemBackgroundBorderless"
174                android:contentDescription="@string/delete_alarm"
175                android:src="@drawable/ic_delete_small" />
176
177            <View
178                android:id="@+id/hairline"
179                android:layout_width="match_parent"
180                android:layout_height="1dp"
181                android:layout_gravity="bottom"
182                android:layout_marginEnd="8dp"
183                android:layout_marginStart="8dp"
184                android:background="@color/hairline" />
185
186            <com.android.deskclock.widget.EllipsizeLayout
187                android:id="@+id/summary"
188                android:layout_width="match_parent"
189                android:layout_height="match_parent"
190                android:layout_marginBottom="@dimen/alarm_clock_vertical_margin"
191                android:gravity="center_vertical">
192
193                <TextView
194                    android:id="@+id/label"
195                    android:layout_width="wrap_content"
196                    android:layout_height="wrap_content"
197                    android:ellipsize="none"
198                    android:singleLine="true"
199                    android:paddingEnd="4dip"
200                    android:textSize="16sp"
201                    android:textColor="@color/clock_gray" />
202
203                <TextView
204                    android:id="@+id/daysOfWeek"
205                    android:layout_width="wrap_content"
206                    android:layout_height="wrap_content"
207                    android:ellipsize="end"
208                    android:singleLine="true"
209                    android:textSize="16sp"
210                    android:textStyle="bold"
211                    android:textColor="@color/clock_white" />
212
213                <TextView
214                    android:id="@+id/tomorrowLabel"
215                    android:layout_width="wrap_content"
216                    android:layout_height="wrap_content"
217                    android:ellipsize="end"
218                    android:singleLine="true"
219                    android:textSize="16sp"
220                    android:textStyle="bold"
221                    android:textColor="@color/clock_white" />
222
223            </com.android.deskclock.widget.EllipsizeLayout>
224
225            <ImageView
226                android:id="@+id/arrow"
227                android:layout_width="wrap_content"
228                android:layout_height="48dip"
229                android:layout_gravity="center_vertical|end"
230                android:layout_marginTop="@dimen/alarm_clock_vertical_margin"
231                android:layout_marginBottom="@dimen/alarm_clock_vertical_margin"
232                android:contentDescription="@string/expand_alarm"
233                android:src="@drawable/ic_expand_down" />
234        </FrameLayout>
235    </FrameLayout>
236
237</LinearLayout>
238