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
120            <!-- Note there's no "dtmfDialerField" EditText here;
121                 in the OTA UI there's no visible "digits" display
122                 attached to the dialpad. -->
123
124            <!-- Keypad section -->
125            <include layout="@layout/dialpad" />
126
127        </com.android.phone.DTMFTwelveKeyDialerView>
128
129    </LinearLayout>
130
131    <!-- Separator / placeholder view between the widgets at the upper
132         part of the screen and the buttons at the bottom.  This view sets
133         layout_weight="1" to ensure that the buttons will be positioned
134         at the very bottom of the screen. -->
135    <View android:id="@+id/otaSeparator"
136        android:layout_width="match_parent"
137        android:layout_height="0dip"
138        android:layout_weight="1"
139    />
140
141    <!-- "Speaker" button -->
142    <ToggleButton android:id="@+id/otaSpeakerButton"
143              android:layout_gravity="center"
144              android:textOn="@string/ota_speaker"
145              android:textOff="@string/ota_speaker"
146              style="@style/ccOtaButton" />
147
148    <!-- (2) Activate/cancel buttons -->
149    <RelativeLayout android:id="@+id/callCardOtaActivate"
150                    android:visibility="gone"
151                    style="@style/ccOtaButtonBar" >
152
153        <!-- "Activate" button -->
154        <Button android:id="@+id/otaActivateButton"
155                android:text="@string/ota_activate"
156                style="@style/ccOtaNextButton" />
157
158        <!-- "Skip" button -->   <!--  TODO: borrowing another button's label for now because I missed the localization deadline for adding a @string/ota_skip -->
159        <Button android:id="@+id/otaSkipButton"
160                android:text="@string/ota_skip_activation_dialog_skip_label"
161                style="@style/ccOtaSkipButton" />
162
163    </RelativeLayout>
164
165    <!-- (3) OTA listen/progress buttons -->
166    <RelativeLayout android:id="@+id/callCardOtaListenProgress"
167                    android:visibility="gone"
168                    style="@style/ccOtaButtonBar" >
169
170        <!-- "End" button -->
171        <Button android:id="@+id/otaEndButton"
172                android:text="@string/ota_call_end"
173                android:drawableStart="@drawable/ic_btn_back"
174                android:drawablePadding="3dip"
175                style="@style/ccOtaSkipButton" />
176    </RelativeLayout>
177
178    <!-- (4) OTA Success/Failure button -->
179    <RelativeLayout android:id="@+id/callCardOtaFailOrSuccessful"
180                    android:visibility="gone"
181                    style="@style/ccOtaButtonBar" >
182
183        <!-- "Next" button -->
184        <Button android:id="@+id/otaNextButton"
185                android:text="@string/ota_next"
186                android:drawableEnd="@drawable/ic_btn_next"
187                android:drawablePadding="10dip"
188                style="@style/ccOtaNextButton" />
189
190        <!-- "Try Again" button -->
191        <Button android:id="@+id/otaTryAgainButton"
192                android:text="@string/ota_try_again"
193                style="@style/ccOtaSkipButton" />
194    </RelativeLayout>
195</LinearLayout>
196