• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3/*
4 * Copyright (C) 2011, 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<LinearLayout
20    xmlns:android="http://schemas.android.com/apk/res/android"
21    android:orientation="vertical"
22    android:layout_width="match_parent"
23    android:layout_height="match_parent"
24    android:background="#ff000000"
25    android:paddingLeft="@dimen/left_right_padding"
26    android:paddingRight="@dimen/left_right_padding"
27    android:paddingTop="@dimen/top_bottom_padding"
28    android:paddingBottom="@dimen/top_bottom_padding">
29
30    <LinearLayout
31        android:layout_width="match_parent"
32        android:layout_height="0dp"
33        android:layout_weight="1"
34        android:layout_marginBottom="@dimen/group_padding"
35        android:background="@drawable/calculator_input_field">
36
37        <com.android.calculator2.CalculatorDisplay
38            android:id="@+id/display"
39            android:layout_width="0dp"
40            android:layout_weight="1"
41            android:layout_height="match_parent"
42            maxDigits="@integer/max_digits"
43            >
44
45            <com.android.calculator2.CalculatorEditText
46                style="@style/display_style" />
47            <com.android.calculator2.CalculatorEditText
48                style="@style/display_style" />
49
50        </com.android.calculator2.CalculatorDisplay>
51
52        <FrameLayout
53            android:layout_width="100dip"
54            android:layout_height="match_parent">
55            <Button
56                android:id="@+id/clear"
57                android:text="@string/clear"
58                style="@style/btn_clear"
59                android:layout_width="match_parent"
60                android:layout_height="match_parent"
61                android:paddingLeft="5dip"
62                android:paddingRight="5dip" />
63            <ImageButton
64                android:id="@+id/del"
65                android:src="@drawable/calc_clear_symbol"
66                style="@style/btn_clear"
67                android:layout_width="match_parent"
68                android:layout_height="match_parent"
69                android:paddingLeft="5dip"
70                android:paddingRight="5dip" />
71        </FrameLayout>
72    </LinearLayout>
73
74    <LinearLayout
75        android:layout_width="match_parent"
76        android:layout_height="0dip"
77        android:layout_weight="4"
78        android:orientation="horizontal">
79
80        <LinearLayout
81            android:layout_width="0dip"
82            android:layout_height="match_parent"
83            android:layout_weight="2"
84            android:orientation="vertical"
85            android:layout_marginRight="@dimen/group_padding">
86            <LinearLayout
87                style="@style/btn_row_style">
88                <Button
89                    android:id="@+id/sin"
90                    android:text="@string/sin"
91                    style="@style/btn_function_cell_style" />
92                <Button
93                    android:id="@+id/ln"
94                    android:text="@string/ln"
95                    style="@style/btn_function_cell_style" />
96            </LinearLayout>
97            <LinearLayout
98                style="@style/btn_row_style">
99                <Button
100                    android:id="@+id/cos"
101                    android:text="@string/cos"
102                    style="@style/btn_function_cell_style" />
103                <Button
104                    android:id="@+id/lg"
105                    android:text="@string/lg"
106                    style="@style/btn_function_cell_style" />
107            </LinearLayout>
108            <LinearLayout
109                style="@style/btn_row_style">
110                <Button
111                    android:id="@+id/tan"
112                    android:text="@string/tan"
113                    style="@style/btn_function_cell_style" />
114                <Button
115                    android:id="@+id/e"
116                    android:text="@string/e"
117                    style="@style/btn_function_cell_style" />
118            </LinearLayout>
119            <LinearLayout
120                style="@style/btn_row_style">
121                <Button
122                    android:id="@+id/pi"
123                    android:text="@string/pi"
124                    style="@style/btn_function_cell_style" />
125                <Button
126                    android:id="@+id/power"
127                    android:text="@string/power"
128                    style="@style/btn_function_cell_style" />
129            </LinearLayout>
130            <LinearLayout
131                style="@style/btn_row_style">
132                <Button
133                    android:id="@+id/factorial"
134                    android:text="@string/factorial"
135                    style="@style/btn_function_cell_style" />
136                <Button
137                    android:id="@+id/sqrt"
138                    android:text="@string/sqrt"
139                    style="@style/btn_function_cell_style" />
140            </LinearLayout>
141        </LinearLayout>
142
143        <LinearLayout
144            android:layout_width="0dip"
145            android:layout_height="match_parent"
146            android:layout_weight="5"
147            android:orientation="vertical">
148            <LinearLayout
149                style="@style/btn_row_style">
150                <Button
151                    android:id="@+id/digit7"
152                    android:text="@string/digit7"
153                    style="@style/btn_digit_cell_style" />
154                <Button
155                    android:id="@+id/digit8"
156                    android:text="@string/digit8"
157                    style="@style/btn_digit_cell_style" />
158                <Button
159                    android:id="@+id/digit9"
160                    android:text="@string/digit9"
161                    style="@style/btn_digit_cell_style" />
162                <Button
163                    android:id="@+id/div"
164                    android:text="@string/div"
165                    style="@style/btn_operation_cell_style" />
166                <Button
167                    android:id="@+id/leftParen"
168                    android:text="@string/leftParen"
169                    style="@style/btn_operation_cell_style" />
170            </LinearLayout>
171            <LinearLayout
172                style="@style/btn_row_style">
173                <Button
174                    android:id="@+id/digit4"
175                    android:text="@string/digit4"
176                    style="@style/btn_digit_cell_style" />
177                <Button
178                    android:id="@+id/digit5"
179                    android:text="@string/digit5"
180                    style="@style/btn_digit_cell_style" />
181                <Button
182                    android:id="@+id/digit6"
183                    android:text="@string/digit6"
184                    style="@style/btn_digit_cell_style" />
185                <Button
186                    android:id="@+id/mul"
187                    android:text="@string/mul"
188                    style="@style/btn_operation_cell_style" />
189                <Button
190                    android:id="@+id/rightParen"
191                    android:text="@string/rightParen"
192                    style="@style/btn_operation_cell_style" />
193            </LinearLayout>
194            <LinearLayout
195                android:layout_width="match_parent"
196                android:layout_height="0dip"
197                android:layout_weight="2"
198                android:orientation="horizontal">
199                <LinearLayout
200                    android:layout_width="0dip"
201                    android:layout_height="match_parent"
202                    android:layout_weight="4"
203                    android:orientation="vertical">
204                    <LinearLayout
205                        style="@style/btn_row_style">
206                        <Button
207                            android:id="@+id/digit1"
208                            android:text="@string/digit1"
209                            style="@style/btn_digit_cell_style" />
210                        <Button
211                            android:id="@+id/digit2"
212                            android:text="@string/digit2"
213                            style="@style/btn_digit_cell_style" />
214                        <Button
215                            android:id="@+id/digit3"
216                            android:text="@string/digit3"
217                            style="@style/btn_digit_cell_style" />
218                        <Button
219                            android:id="@+id/minus"
220                            android:text="@string/minus"
221                            style="@style/btn_operation_cell_style" />
222                    </LinearLayout>
223                    <LinearLayout
224                        style="@style/btn_row_style">
225                        <Button
226                            android:id="@+id/digit0"
227                            android:text="@string/digit0"
228                            style="@style/btn_digit_cell_style"
229                            android:layout_weight="2" />
230                        <Button
231                            android:id="@+id/dot"
232                            android:text="@string/dot"
233                            style="@style/btn_digit_cell_style" />
234                        <Button
235                            android:id="@+id/plus"
236                            android:text="@string/plus"
237                            style="@style/btn_operation_cell_style" />
238                    </LinearLayout>
239                </LinearLayout>
240                <Button
241                    android:id="@+id/equal"
242                    android:text="@string/equal"
243                    style="@style/btn_operation_cell_style" />
244            </LinearLayout>
245        </LinearLayout>
246    </LinearLayout>
247</LinearLayout>
248