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="wrap_content" 33 android:layout_marginBottom="@dimen/group_padding" 34 android:background="@drawable/calculator_input_field"> 35 36 <com.android.calculator2.CalculatorDisplay 37 android:id="@+id/display" 38 android:layout_width="0dip" 39 android:layout_weight="1" 40 android:layout_height="wrap_content" 41 maxDigits="@integer/max_digits" 42 android:layout_alignParentTop="true" 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="wrap_content" 54 android:layout_height="match_parent" 55 android:layout_alignParentTop="true"> 56 <Button 57 android:id="@+id/clear" 58 android:text="@string/clear" 59 style="@style/btn_clear" 60 android:minWidth="100dp" 61 android:layout_width="match_parent" 62 android:layout_height="match_parent" 63 android:paddingLeft="5dip" 64 android:paddingRight="5dip" 65 android:contentDescription="@string/clearDesc" /> 66 <ImageButton 67 android:id="@+id/del" 68 android:src="@drawable/calc_clear_symbol" 69 style="@style/btn_clear" 70 android:layout_width="match_parent" 71 android:layout_height="match_parent" 72 android:paddingLeft="5dip" 73 android:paddingRight="5dip" 74 android:contentDescription="@string/delDesc" /> 75 </FrameLayout> 76 </LinearLayout> 77 78 <LinearLayout 79 android:layout_width="match_parent" 80 android:layout_height="0dip" 81 android:layout_weight="4" 82 android:orientation="horizontal"> 83 84 <LinearLayout 85 android:layout_width="0dip" 86 android:layout_height="match_parent" 87 android:layout_weight="2" 88 android:orientation="vertical" 89 android:layout_marginRight="@dimen/group_padding"> 90 <LinearLayout 91 style="@style/btn_row_style"> 92 <Button 93 android:id="@+id/sin" 94 android:text="@string/sin" 95 style="@style/btn_function_cell_style" 96 android:contentDescription="@string/sinDesc" /> 97 <Button 98 android:id="@+id/ln" 99 android:text="@string/ln" 100 style="@style/btn_function_cell_style" 101 android:contentDescription="@string/lnDesc" /> 102 </LinearLayout> 103 <LinearLayout 104 style="@style/btn_row_style"> 105 <Button 106 android:id="@+id/cos" 107 android:text="@string/cos" 108 style="@style/btn_function_cell_style" 109 android:contentDescription="@string/cosDesc" /> 110 <Button 111 android:id="@+id/lg" 112 android:text="@string/lg" 113 style="@style/btn_function_cell_style" 114 android:contentDescription="@string/lgDesc" /> 115 </LinearLayout> 116 <LinearLayout 117 style="@style/btn_row_style"> 118 <Button 119 android:id="@+id/tan" 120 android:text="@string/tan" 121 style="@style/btn_function_cell_style" 122 android:contentDescription="@string/tanDesc" /> 123 <Button 124 android:id="@+id/e" 125 android:text="@string/e" 126 style="@style/btn_function_cell_style" 127 android:contentDescription="@string/eDesc" /> 128 </LinearLayout> 129 <LinearLayout 130 style="@style/btn_row_style"> 131 <Button 132 android:id="@+id/pi" 133 android:text="@string/pi" 134 style="@style/btn_function_cell_style" 135 android:contentDescription="@string/piDesc" /> 136 <Button 137 android:id="@+id/power" 138 android:text="@string/power" 139 style="@style/btn_function_cell_style" 140 android:contentDescription="@string/powerDesc" /> 141 </LinearLayout> 142 <LinearLayout 143 style="@style/btn_row_style"> 144 <Button 145 android:id="@+id/factorial" 146 android:text="@string/factorial" 147 style="@style/btn_function_cell_style" 148 android:contentDescription="@string/factorialDesc" /> 149 <Button 150 android:id="@+id/sqrt" 151 android:text="@string/sqrt" 152 style="@style/btn_function_cell_style" 153 android:contentDescription="@string/sqrtDesc" /> 154 </LinearLayout> 155 </LinearLayout> 156 157 <LinearLayout 158 android:layout_width="0dip" 159 android:layout_height="match_parent" 160 android:layout_weight="5" 161 android:orientation="vertical"> 162 <LinearLayout 163 style="@style/btn_row_style"> 164 <Button 165 android:id="@+id/digit7" 166 android:text="@string/digit7" 167 style="@style/btn_digit_cell_style" /> 168 <Button 169 android:id="@+id/digit8" 170 android:text="@string/digit8" 171 style="@style/btn_digit_cell_style" /> 172 <Button 173 android:id="@+id/digit9" 174 android:text="@string/digit9" 175 style="@style/btn_digit_cell_style" /> 176 <Button 177 android:id="@+id/div" 178 android:text="@string/div" 179 style="@style/btn_operation_cell_style" 180 android:contentDescription="@string/divDesc" /> 181 <Button 182 android:id="@+id/leftParen" 183 android:text="@string/leftParen" 184 style="@style/btn_operation_cell_style" 185 android:contentDescription="@string/leftParenDesc" /> 186 </LinearLayout> 187 <LinearLayout 188 style="@style/btn_row_style"> 189 <Button 190 android:id="@+id/digit4" 191 android:text="@string/digit4" 192 style="@style/btn_digit_cell_style" /> 193 <Button 194 android:id="@+id/digit5" 195 android:text="@string/digit5" 196 style="@style/btn_digit_cell_style" /> 197 <Button 198 android:id="@+id/digit6" 199 android:text="@string/digit6" 200 style="@style/btn_digit_cell_style" /> 201 <Button 202 android:id="@+id/mul" 203 android:text="@string/mul" 204 style="@style/btn_operation_cell_style" 205 android:contentDescription="@string/mulDesc" /> 206 <Button 207 android:id="@+id/rightParen" 208 android:text="@string/rightParen" 209 style="@style/btn_operation_cell_style" 210 android:contentDescription="@string/rightParenDesc" /> 211 </LinearLayout> 212 <LinearLayout 213 android:layout_width="match_parent" 214 android:layout_height="0dip" 215 android:layout_weight="2" 216 android:orientation="horizontal"> 217 <LinearLayout 218 android:layout_width="0dip" 219 android:layout_height="match_parent" 220 android:layout_weight="4" 221 android:orientation="vertical"> 222 <LinearLayout 223 style="@style/btn_row_style"> 224 <Button 225 android:id="@+id/digit1" 226 android:text="@string/digit1" 227 style="@style/btn_digit_cell_style" /> 228 <Button 229 android:id="@+id/digit2" 230 android:text="@string/digit2" 231 style="@style/btn_digit_cell_style" /> 232 <Button 233 android:id="@+id/digit3" 234 android:text="@string/digit3" 235 style="@style/btn_digit_cell_style" /> 236 <Button 237 android:id="@+id/minus" 238 android:text="@string/minus" 239 style="@style/btn_operation_cell_style" 240 android:contentDescription="@string/minusDesc" /> 241 </LinearLayout> 242 <LinearLayout 243 style="@style/btn_row_style"> 244 <Button 245 android:id="@+id/digit0" 246 android:text="@string/digit0" 247 style="@style/btn_digit_cell_style" 248 android:layout_weight="2" /> 249 <Button 250 android:id="@+id/dot" 251 android:text="@string/dot" 252 style="@style/btn_digit_cell_style" 253 android:contentDescription="@string/dotDesc" /> 254 <Button 255 android:id="@+id/plus" 256 android:text="@string/plus" 257 style="@style/btn_operation_cell_style" 258 android:contentDescription="@string/plusDesc" /> 259 </LinearLayout> 260 </LinearLayout> 261 <Button 262 android:id="@+id/equal" 263 android:text="@string/equal" 264 style="@style/btn_operation_cell_style" 265 android:contentDescription="@string/equalDesc" /> 266 </LinearLayout> 267 </LinearLayout> 268 </LinearLayout> 269 </LinearLayout> 270