• 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    xmlns:android="http://schemas.android.com/apk/res/android"
19    android:layout_width="match_parent"
20    android:layout_height="wrap_content"
21    android:orientation="horizontal">
22
23    <!-- I can't use a normal checkbox here for a couple reasons:
24         1. The checkbox button resources cannot contain layouts so I have to
25            use 2 views for the clock and the bar.
26         2. The normal checkbox has a really messed up layout. Using the button
27            attribute produces a left-aligned image that has some kind of
28            minimum height. If the bar is a checkbox, it is too tall and is
29            clipped on the right.
30    -->
31    <com.android.deskclock.DontPressWithParentLayout android:id="@+id/indicator"
32        style="@style/alarm_list_left_column"
33        android:background="@drawable/clock_selector"
34        android:gravity="center"
35        android:orientation="vertical">
36        <CheckBox android:id="@+id/clock_onoff"
37            android:focusable="false"
38            android:clickable="false"
39            android:background="@drawable/indicator_clock_onoff"
40            android:duplicateParentState="true"
41            android:layout_height="wrap_content"
42            android:layout_width="wrap_content"
43            android:layout_gravity="center"
44            android:button="@null" />
45        <ImageView android:id="@+id/bar_onoff"
46            android:layout_width="wrap_content"
47            android:layout_height="wrap_content"
48            android:layout_gravity="center"
49            android:paddingTop="4dip"
50            android:src="@drawable/ic_indicator_off" />
51    </com.android.deskclock.DontPressWithParentLayout>
52
53    <ImageView
54        android:src="@drawable/divider_vertical_dark"
55        android:background="?android:attr/windowBackground"
56        android:layout_width="wrap_content"
57        android:layout_height="match_parent"
58        android:paddingTop="4dip"
59        android:paddingBottom="4dip"
60        android:scaleType="fitXY"
61        android:gravity="fill_vertical" />
62
63    <!-- A layout that displays the time.  Shows time, am/pm (if 12-hour),
64         and an optional line below, used for day/days of week -->
65    <com.android.deskclock.DigitalClock android:id="@+id/digitalClock"
66        android:layout_width="wrap_content"
67        android:layout_height="match_parent"
68        android:gravity="center_vertical"
69        android:layout_weight="1"
70        android:orientation="vertical"
71        android:paddingLeft="16dip"
72        android:paddingRight="16dip">
73
74        <LinearLayout
75            android:layout_width="match_parent"
76            android:layout_height="wrap_content"
77            android:baselineAligned="true">
78
79            <TextView android:id="@+id/timeDisplay"
80                android:includeFontPadding="false"
81                android:layout_width="wrap_content"
82                android:layout_height="wrap_content"
83                android:paddingRight="6dip"
84                android:textSize="28sp"
85                android:textColor="?android:attr/textColorPrimary"/>
86
87            <TextView android:id="@+id/am_pm"
88                android:layout_width="wrap_content"
89                android:layout_height="wrap_content"
90                android:textAppearance="?android:attr/textAppearanceSmall"
91                android:textStyle="bold"
92                android:textColor="?android:attr/textColorPrimary"/>
93
94            <TextView android:id="@+id/label"
95                android:layout_width="wrap_content"
96                android:layout_height="wrap_content"
97                android:layout_weight="1"
98                android:paddingLeft="8dip"
99                android:textAppearance="?android:attr/textAppearanceSmall"
100                android:textColor="?android:attr/textColorTertiary"
101                android:textStyle="bold"
102                android:gravity="right"
103                android:singleLine="true"/>
104
105        </LinearLayout>
106
107        <TextView android:id="@+id/daysOfWeek"
108            android:includeFontPadding="false"
109            android:layout_width="match_parent"
110            android:layout_height="wrap_content"
111            android:textAppearance="?android:attr/textAppearanceSmall"
112            android:textColor="?android:attr/textColorSecondary"/>
113
114    </com.android.deskclock.DigitalClock>
115
116</LinearLayout>
117