1 <?xml version="1.0" encoding="utf-8"?>
3 Copyright (C) 2015 The Android Open Source Project
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
9 http://www.apache.org/licenses/LICENSE-2.0
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.
18 <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
19 android:layout_width="match_parent"
20 android:layout_height="match_parent"
21 android:layoutDirection="ltr">
23 <!-- Provides a background for the time layout that extends into the button bar area. -->
24 <com.android.internal.widget.DrawingSpace
25 android:id="@+id/time_header"
26 android:layout_width="0dp"
27 android:layout_height="wrap_content"
28 android:layout_column="@dimen/time_picker_column_start_material"
29 android:layout_row="0"
30 android:layout_rowSpan="3"
31 android:layout_gravity="center|fill"
32 android:layoutDirection="locale" />
35 android:layout_width="wrap_content"
36 android:layout_height="wrap_content"
37 android:layout_column="@dimen/time_picker_column_start_material"
38 android:layout_row="1"
39 android:layout_gravity="center|fill"
40 android:paddingStart="?attr/dialogPreferredPadding"
41 android:paddingEnd="?attr/dialogPreferredPadding">
44 android:id="@+id/time_layout"
45 android:layout_width="wrap_content"
46 android:layout_height="wrap_content"
47 android:orientation="horizontal"
48 android:layout_centerInParent="true"
49 android:paddingTop="@dimen/timepicker_radial_picker_top_margin"
50 android:layout_marginBottom="-12dp">
52 <!-- The hour should always be to the left of the separator,
53 regardless of the current locale's layout direction. -->
54 <com.android.internal.widget.NumericTextView
55 android:id="@+id/hours"
56 android:layout_width="wrap_content"
57 android:layout_height="wrap_content"
58 android:textAppearance="@style/TextAppearance.Material.TimePicker.TimeLabel"
59 android:background="@drawable/time_picker_editable_background"
60 android:singleLine="true"
61 android:ellipsize="none"
62 android:gravity="right"
63 android:focusable="true"
64 android:nextFocusForward="@+id/minutes" />
67 android:id="@+id/separator"
68 android:layout_width="wrap_content"
69 android:layout_height="wrap_content"
70 android:textAppearance="@style/TextAppearance.Material.TimePicker.TimeLabel"
71 android:importantForAccessibility="no"
72 android:includeFontPadding="false" />
74 <!-- The minutes should always be to the right of the separator,
75 regardless of the current locale's layout direction. -->
76 <com.android.internal.widget.NumericTextView
77 android:id="@+id/minutes"
78 android:layout_width="wrap_content"
79 android:layout_height="wrap_content"
80 android:textAppearance="@style/TextAppearance.Material.TimePicker.TimeLabel"
81 android:background="@drawable/time_picker_editable_background"
82 android:singleLine="true"
83 android:ellipsize="none"
84 android:gravity="left"
85 android:focusable="true"
86 android:nextFocusForward="@+id/am_label" />
90 android:id="@+id/ampm_layout"
91 android:layout_width="wrap_content"
92 android:layout_height="wrap_content"
93 android:layout_below="@+id/time_layout"
94 android:layout_centerHorizontal="true"
95 android:paddingTop="4dp"
96 android:paddingBottom="4dp"
97 android:orientation="vertical"
98 android:layoutDirection="locale">
100 android:id="@+id/am_label"
101 android:layout_width="wrap_content"
102 android:layout_height="wrap_content"
103 android:padding="8dp"
104 android:layout_marginBottom="-8dp"
105 android:textAppearance="@style/TextAppearance.Material.TimePicker.AmPmLabel"
107 android:ellipsize="none"
108 android:focusable="true"
109 android:background="?android:attr/selectableItemBackground"
110 android:includeFontPadding="false"
111 android:nextFocusForward="@+id/pm_label"
112 android:button="@null" />
114 android:id="@+id/pm_label"
115 android:layout_width="wrap_content"
116 android:layout_height="wrap_content"
117 android:padding="8dp"
118 android:textAppearance="@style/TextAppearance.Material.TimePicker.AmPmLabel"
120 android:ellipsize="none"
121 android:focusable="true"
122 android:background="?android:attr/selectableItemBackground"
123 android:includeFontPadding="false"
124 android:button="@null" />
129 android:id="@id/topPanel"
130 android:layout="@layout/alert_dialog_title_material"
131 android:layout_width="wrap_content"
132 android:layout_height="wrap_content"
133 android:layout_column="@dimen/time_picker_column_end_material"
134 android:layout_row="0"
135 android:layout_gravity="top|fill_horizontal"
136 android:layoutDirection="locale" />
138 <android.widget.RadialTimePickerView
139 android:id="@+id/radial_picker"
140 android:layout_width="@dimen/timepicker_radial_picker_dimen"
141 android:layout_height="@dimen/timepicker_radial_picker_dimen"
142 android:layout_column="@dimen/time_picker_column_end_material"
143 android:layout_row="1"
144 android:layout_rowWeight="1"
145 android:layout_gravity="center|fill"
146 android:layout_marginTop="@dimen/timepicker_radial_picker_top_margin"
147 android:layout_marginStart="@dimen/timepicker_radial_picker_horizontal_margin"
148 android:layout_marginEnd="@dimen/timepicker_radial_picker_horizontal_margin"
149 android:layoutDirection="locale" />
152 android:id="@id/buttonPanel"
153 android:layout="@layout/alert_dialog_button_bar_material"
154 android:layout_width="wrap_content"
155 android:layout_height="wrap_content"
156 android:layout_column="@dimen/time_picker_column_end_material"
157 android:layout_row="2"
158 android:layout_gravity="bottom|fill_horizontal"
159 android:layoutDirection="locale" />