1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2013 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<!-- This layout is duplicated in land/time_picker_material.xml, so any 19 changes made here need to be manually copied over. --> 20<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 21 android:id="@+id/time_header" 22 android:layout_width="match_parent" 23 android:layout_height="match_parent" 24 android:paddingStart="16dp" 25 android:paddingEnd="16dp"> 26 27 <!-- The hour should always be to the left of the separator, 28 regardless of the current locale's layout direction. --> 29 <com.android.internal.widget.NumericTextView 30 android:id="@+id/hours" 31 android:layout_width="wrap_content" 32 android:layout_height="wrap_content" 33 android:layout_toLeftOf="@+id/separator" 34 android:layout_alignBaseline="@+id/separator" 35 android:textAppearance="@style/TextAppearance.Material.TimePicker.TimeLabel" 36 android:background="@drawable/time_picker_editable_background" 37 android:singleLine="true" 38 android:ellipsize="none" 39 android:gravity="right" 40 android:focusable="true" 41 android:pointerIcon="hand" 42 android:nextFocusForward="@+id/minutes" /> 43 44 <TextView 45 android:id="@+id/separator" 46 android:layout_width="wrap_content" 47 android:layout_height="wrap_content" 48 android:layout_marginLeft="@dimen/timepicker_separator_padding" 49 android:layout_marginRight="@dimen/timepicker_separator_padding" 50 android:layout_centerInParent="true" 51 android:paddingBottom="4dp" 52 android:textAppearance="@style/TextAppearance.Material.TimePicker.TimeLabel" 53 android:importantForAccessibility="no" /> 54 55 <!-- The minutes should always be to the right of the separator, 56 regardless of the current locale's layout direction. --> 57 <com.android.internal.widget.NumericTextView 58 android:id="@+id/minutes" 59 android:layout_width="wrap_content" 60 android:layout_height="wrap_content" 61 android:layout_toRightOf="@+id/separator" 62 android:layout_alignBaseline="@+id/separator" 63 android:textAppearance="@style/TextAppearance.Material.TimePicker.TimeLabel" 64 android:background="@drawable/time_picker_editable_background" 65 android:singleLine="true" 66 android:ellipsize="none" 67 android:gravity="left" 68 android:focusable="true" 69 android:pointerIcon="hand" 70 android:nextFocusForward="@+id/am_label" /> 71 72 <!-- The layout alignment of this view will switch between toRightOf 73 @id/minutes and toLeftOf @id/hours depending on the locale. --> 74 <RadioGroup 75 android:id="@+id/ampm_layout" 76 android:layout_width="wrap_content" 77 android:layout_height="wrap_content" 78 android:layout_toRightOf="@+id/minutes" 79 android:layout_alignBaseline="@+id/minutes" 80 android:layout_marginStart="8dp" 81 android:layout_marginEnd="0dp" 82 android:orientation="vertical" 83 android:baselineAlignedChildIndex="1"> 84 <RadioButton 85 android:id="@+id/am_label" 86 android:layout_width="wrap_content" 87 android:layout_height="wrap_content" 88 android:paddingTop="8dp" 89 android:paddingBottom="8dp" 90 android:layout_marginBottom="-8dp" 91 android:textAppearance="@style/TextAppearance.Material.TimePicker.AmPmLabel" 92 android:lines="1" 93 android:ellipsize="none" 94 android:focusable="true" 95 android:background="?android:attr/selectableItemBackground" 96 android:includeFontPadding="false" 97 android:nextFocusForward="@+id/pm_label" 98 android:button="@null" /> 99 <RadioButton 100 android:id="@+id/pm_label" 101 android:layout_width="wrap_content" 102 android:layout_height="wrap_content" 103 android:paddingTop="8dp" 104 android:paddingBottom="8dp" 105 android:textAppearance="@style/TextAppearance.Material.TimePicker.AmPmLabel" 106 android:lines="1" 107 android:ellipsize="none" 108 android:focusable="true" 109 android:background="?android:attr/selectableItemBackground" 110 android:includeFontPadding="false" 111 android:button="@null" /> 112 </RadioGroup> 113</RelativeLayout> 114