1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2009 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<!-- Top-level container for UI elements used during the OTASP call;
18     see OtaUtils.java.
19
20     This layout file contains the entire OTASP screen, including the
21     status area at the top and touch controls at the bottom of the
22     screen.  The regular CallCard and the InCallTouchUi widget are not
23     used at all during an OTASP call.
24
25     The OTASP screen contains (in order, from top to bottom):
26     - Title and explanatory text
27     - Progress status message
28     - Progress bar
29     - Success / failure message
30     - DTMF dialpad
31     [ Separator / placeholder view between the "upper widgets" above and the buttons below ]
32     - Speaker button
33     - Action buttons like "Activate"/"Skip", or "End", or "Next"
34       (depending on whether we're in the listen/progress state
35       of the final success/failure state.
36
37     Only some of these elements are visible in any given state.
38-->
39<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
40    android:id="@+id/otaTopLevel"
41    android:orientation="vertical"
42    android:gravity="center_horizontal"
43    android:layout_width="match_parent"
44    android:layout_height="match_parent"
45    >
46
47    <LinearLayout android:id="@+id/otaUpperWidgets"
48                  android:orientation="vertical"
49                  android:layout_width="match_parent"
50                  android:layout_height="wrap_content" >
51
52        <!-- Title: "Activate your phone" -->
53        <TextView android:id="@+id/otaTitle"
54                  android:layout_width="match_parent"
55                  android:layout_height="wrap_content"
56                  android:textAppearance="@style/ccOtaWizardTitle"
57                  android:text="@string/ota_title_activate"
58        />
59
60        <View
61                  android:layout_width="wrap_content"
62                  android:layout_height="1dip"
63                  android:layout_gravity="center"
64                  android:background="@drawable/green_divider"
65                  android:layout_marginTop="10dip"
66                  android:focusable="false"
67                  android:clickable="false"
68        />
69
70        <!-- Explanatory text: "A special call needs to be made to activate
71             your phone service"... -->
72        <TextView android:id="@+id/otaActivate"
73                  android:layout_marginTop="@dimen/otaactivate_layout_marginTop"
74                  android:layout_width="match_parent"
75                  android:layout_height="wrap_content"
76                  android:textAppearance="@style/ccOtaTextPrimary"
77                  android:visibility="gone"
78                  android:text="@string/ota_touch_activate"
79                  />
80
81        <!-- Progress status message, e.g. "Please wait while your phone
82             is being programmed" (in some states) -->
83        <TextView android:id="@+id/otaListenProgress"
84                  android:layout_width="match_parent"
85                  android:layout_height="wrap_content"
86                  android:layout_marginTop="@dimen/otalistenprogress_layout_marginTop"
87                  android:textAppearance="@style/ccOtaTextPrimary"
88                  android:visibility="gone"
89                  />
90
91        <!-- Progress bar -->
92        <ProgressBar android:id="@+id/progress_large"
93                     style="?android:attr/progressBarStyleHorizontal"
94                     android:layout_marginTop="20dip"
95                     android:layout_width="match_parent"
96                     android:layout_height="wrap_content"
97                     android:visibility="gone"/>
98
99        <!-- Success or failure message (in some states) -->
100        <TextView android:id="@+id/otaSuccessFailStatus"
101                  android:gravity="start"
102                  android:layout_marginTop="@dimen/otasuccessfail_layout_marginTop"
103                  android:layout_marginStart="5dip"
104                  android:layout_width="match_parent"
105                  android:layout_height="wrap_content"
106                  android:textAppearance="@style/ccOtaTextPrimary"
107                  android:visibility="gone"
108                  />
109
110        <!-- DTMF dialpad -->
111        <com.android.phone.DTMFTwelveKeyDialerView
112                xmlns:android="http://schemas.android.com/apk/res/android"
113                android:id="@+id/otaDtmfDialerView"
114                android:layout_width="match_parent"
115                android:layout_height="wrap_content"
116                android:orientation="vertical"
117                android:layout_marginTop="1dip"
118                android:visibility="gone"
119                android:theme="@style/Dialpad_Light">
120
121            <!-- Note there's no "dtmfDialerField" EditText here;
122                 in the OTA UI there's no visible "digits" display
123                 attached to the dialpad. -->
124
125            <!-- Keypad section -->
126            <include layout="@layout/dialpad" />
127
128        </com.android.phone.DTMFTwelveKeyDialerView>
129
130    </LinearLayout>
131
132    <!-- Separator / placeholder view between the widgets at the upper
133         part of the screen and the buttons at the bottom.  This view sets
134         layout_weight="1" to ensure that the buttons will be positioned
135         at the very bottom of the screen. -->
136    <View android:id="@+id/otaSeparator"
137        android:layout_width="match_parent"
138        android:layout_height="0dip"
139        android:layout_weight="1"
140    />
141
142    <!-- "Speaker" button -->
143    <ToggleButton android:id="@+id/otaSpeakerButton"
144              android:layout_gravity="center"
145              android:textOn="@string/ota_speaker"
146              android:textOff="@string/ota_speaker"
147              style="@style/ccOtaButton" />
148
149    <!-- (2) Activate/cancel buttons -->
150    <RelativeLayout android:id="@+id/callCardOtaActivate"
151                    android:visibility="gone"
152                    style="@style/ccOtaButtonBar" >
153
154        <!-- "Activate" button -->
155        <Button android:id="@+id/otaActivateButton"
156                android:text="@string/ota_activate"
157                style="@style/ccOtaNextButton" />
158
159        <!-- "Skip" button -->   <!--  TODO: borrowing another button's label for now because I missed the localization deadline for adding a @string/ota_skip -->
160        <Button android:id="@+id/otaSkipButton"
161                android:text="@string/ota_skip_activation_dialog_skip_label"
162                style="@style/ccOtaSkipButton" />
163
164    </RelativeLayout>
165
166    <!-- (3) OTA listen/progress buttons -->
167    <RelativeLayout android:id="@+id/callCardOtaListenProgress"
168                    android:visibility="gone"
169                    style="@style/ccOtaButtonBar" >
170
171        <!-- "End" button -->
172        <Button android:id="@+id/otaEndButton"
173                android:text="@string/ota_call_end"
174                android:drawableStart="@drawable/ic_btn_back"
175                android:drawablePadding="3dip"
176                style="@style/ccOtaSkipButton" />
177    </RelativeLayout>
178
179    <!-- (4) OTA Success/Failure button -->
180    <RelativeLayout android:id="@+id/callCardOtaFailOrSuccessful"
181                    android:visibility="gone"
182                    style="@style/ccOtaButtonBar" >
183
184        <!-- "Next" button -->
185        <Button android:id="@+id/otaNextButton"
186                android:text="@string/ota_next"
187                android:drawableEnd="@drawable/ic_btn_next"
188                android:drawablePadding="10dip"
189                style="@style/ccOtaNextButton" />
190
191        <!-- "Try Again" button -->
192        <Button android:id="@+id/otaTryAgainButton"
193                android:text="@string/ota_try_again"
194                style="@style/ccOtaSkipButton" />
195    </RelativeLayout>
196</LinearLayout>
197