• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3**
4** Copyright 2012, The Android Open Source Project
5**
6** Licensed under the Apache License, Version 2.0 (the "License");
7** you may not use this file except in compliance with the License.
8** You may obtain a copy of the License at
9**
10**     http://www.apache.org/licenses/LICENSE-2.0
11**
12** Unless required by applicable law or agreed to in writing, software
13** distributed under the License is distributed on an "AS IS" BASIS,
14** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15** See the License for the specific language governing permissions and
16** limitations under the License.
17*/
18-->
19
20<!-- Layout of date picker-->
21
22<!-- The width of this container is manually set a little bigger than the one of the children
23     contained in it. This helps to prevent rounding errors when toggling the "Show year" option -->
24
25<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
26              android:orientation="vertical"
27              android:layout_gravity="center_horizontal"
28              android:layout_width="270dip"
29              android:layout_height="wrap_content">
30
31    <CheckBox
32            android:id="@+id/yearToggle"
33            android:text="Provide a year"
34            android:paddingTop="5dip"
35            android:paddingBottom="5dip"
36            android:textAppearance="?android:attr/textAppearanceLarge"
37            android:layout_gravity="center_horizontal"
38            android:layout_width="wrap_content"
39            android:layout_height="wrap_content"/>
40    <!-- Warning: everything within the parent is removed and re-ordered depending
41         on the date format selected by the user. -->
42    <LinearLayout
43            android:id="@+id/parent"
44            android:orientation="horizontal"
45            android:layout_gravity="center_horizontal"
46            android:animateLayoutChanges="true"
47            android:layout_width="wrap_content"
48            android:layout_height="wrap_content">
49
50        <!-- Month -->
51        <NumberPicker
52                android:id="@+id/month"
53                android:layout_width="80dip"
54                android:layout_height="wrap_content"
55                android:layout_marginLeft="1dip"
56                android:layout_marginRight="1dip"
57                android:focusable="true"
58                android:focusableInTouchMode="true"
59                />
60
61        <!-- Day -->
62        <NumberPicker
63                android:id="@+id/day"
64                android:layout_width="80dip"
65                android:layout_height="wrap_content"
66                android:layout_marginLeft="1dip"
67                android:layout_marginRight="1dip"
68                android:focusable="true"
69                android:focusableInTouchMode="true"
70                />
71
72        <!-- Year -->
73        <NumberPicker
74                android:id="@+id/year"
75                android:layout_width="95dip"
76                android:layout_height="wrap_content"
77                android:layout_marginLeft="1dip"
78                android:layout_marginRight="1dip"
79                android:focusable="true"
80                android:focusableInTouchMode="true"
81                />
82    </LinearLayout>
83</LinearLayout>
84