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 20 <LinearLayout 21 xmlns:android="http://schemas.android.com/apk/res/android" 22 android:orientation="vertical" 23 android:layout_width="match_parent" 24 android:layout_height="match_parent" 25 android:background="#ff000000" 26 android:paddingLeft="@dimen/left_right_padding" 27 android:paddingRight="@dimen/left_right_padding" 28 android:paddingTop="@dimen/top_bottom_padding" 29 android:paddingBottom="@dimen/top_bottom_padding"> 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="2" 78 android:orientation="vertical" 79 android:layout_marginBottom="@dimen/group_padding"> 80 81 <LinearLayout 82 style="@style/btn_row_style"> 83 <Button 84 android:id="@+id/sin" 85 android:text="@string/sin" 86 style="@style/btn_function_cell_style" /> 87 <Button 88 android:id="@+id/cos" 89 android:text="@string/cos" 90 style="@style/btn_function_cell_style" /> 91 <Button 92 android:id="@+id/tan" 93 android:text="@string/tan" 94 style="@style/btn_function_cell_style" /> 95 <Button 96 android:id="@+id/pi" 97 android:text="@string/pi" 98 style="@style/btn_function_cell_style" /> 99 <Button 100 android:id="@+id/factorial" 101 android:text="@string/factorial" 102 style="@style/btn_function_cell_style" /> 103 </LinearLayout> 104 <LinearLayout 105 style="@style/btn_row_style"> 106 <Button 107 android:id="@+id/ln" 108 android:text="@string/ln" 109 style="@style/btn_function_cell_style" /> 110 <Button 111 android:id="@+id/lg" 112 android:text="@string/lg" 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 <Button 119 android:id="@+id/power" 120 android:text="@string/power" 121 style="@style/btn_function_cell_style" /> 122 <Button 123 android:id="@+id/sqrt" 124 android:text="@string/sqrt" 125 style="@style/btn_function_cell_style" /> 126 </LinearLayout> 127 128 </LinearLayout> 129 130 <LinearLayout 131 android:layout_width="match_parent" 132 android:layout_height="0dip" 133 android:layout_weight="5" 134 android:orientation="vertical"> 135 <LinearLayout 136 style="@style/btn_row_style"> 137 <Button 138 android:id="@+id/digit7" 139 android:text="@string/digit7" 140 style="@style/btn_digit_cell_style" /> 141 <Button 142 android:id="@+id/digit8" 143 android:text="@string/digit8" 144 style="@style/btn_digit_cell_style" /> 145 <Button 146 android:id="@+id/digit9" 147 android:text="@string/digit9" 148 style="@style/btn_digit_cell_style" /> 149 <Button 150 android:id="@+id/div" 151 android:text="@string/div" 152 style="@style/btn_operation_cell_style" /> 153 <Button 154 android:id="@+id/leftParen" 155 android:text="@string/leftParen" 156 style="@style/btn_operation_cell_style" /> 157 </LinearLayout> 158 <LinearLayout 159 style="@style/btn_row_style"> 160 <Button 161 android:id="@+id/digit4" 162 android:text="@string/digit4" 163 style="@style/btn_digit_cell_style" /> 164 <Button 165 android:id="@+id/digit5" 166 android:text="@string/digit5" 167 style="@style/btn_digit_cell_style" /> 168 <Button 169 android:id="@+id/digit6" 170 android:text="@string/digit6" 171 style="@style/btn_digit_cell_style" /> 172 <Button 173 android:id="@+id/mul" 174 android:text="@string/mul" 175 style="@style/btn_operation_cell_style" /> 176 <Button 177 android:id="@+id/rightParen" 178 android:text="@string/rightParen" 179 style="@style/btn_operation_cell_style" /> 180 </LinearLayout> 181 <LinearLayout 182 android:layout_width="match_parent" 183 android:layout_height="0dip" 184 android:layout_weight="2" 185 android:orientation="horizontal"> 186 <LinearLayout 187 android:layout_width="0dip" 188 android:layout_height="match_parent" 189 android:layout_weight="4" 190 android:orientation="vertical"> 191 <LinearLayout 192 style="@style/btn_row_style"> 193 <Button 194 android:id="@+id/digit1" 195 android:text="@string/digit1" 196 style="@style/btn_digit_cell_style" /> 197 <Button 198 android:id="@+id/digit2" 199 android:text="@string/digit2" 200 style="@style/btn_digit_cell_style" /> 201 <Button 202 android:id="@+id/digit3" 203 android:text="@string/digit3" 204 style="@style/btn_digit_cell_style" /> 205 <Button 206 android:id="@+id/minus" 207 android:text="@string/minus" 208 style="@style/btn_operation_cell_style" /> 209 </LinearLayout> 210 <LinearLayout 211 style="@style/btn_row_style"> 212 <Button 213 android:id="@+id/digit0" 214 android:text="@string/digit0" 215 style="@style/btn_digit_cell_style" 216 android:layout_weight="2" /> 217 <Button 218 android:id="@+id/dot" 219 android:text="@string/dot" 220 style="@style/btn_digit_cell_style" /> 221 <Button 222 android:id="@+id/plus" 223 android:text="@string/plus" 224 style="@style/btn_operation_cell_style" /> 225 </LinearLayout> 226 </LinearLayout> 227 <Button 228 android:id="@+id/equal" 229 android:text="@string/equal" 230 style="@style/btn_operation_cell_style" /> 231 </LinearLayout> 232 </LinearLayout> 233 </LinearLayout> 234