|
6 | 6 | android:layout_height="match_parent" |
7 | 7 | android:paddingLeft="0dp" |
8 | 8 | android:paddingRight="0dp" |
9 | | - android:orientation="vertical"> |
| 9 | + android:orientation="vertical" |
| 10 | + android:weightSum="100"> |
10 | 11 |
|
11 | 12 | <!--This is for the number view--> |
12 | 13 | <LinearLayout |
13 | 14 | android:layout_width="match_parent" |
14 | | - android:layout_height="wrap_content"> |
| 15 | + android:layout_height="0dp" |
| 16 | + android:layout_weight="25"> |
15 | 17 |
|
16 | 18 | <TextView |
| 19 | + android:id="@+id/textView" |
17 | 20 | android:layout_width="match_parent" |
18 | 21 | android:layout_height="wrap_content" |
19 | 22 | android:layout_gravity="end" |
20 | 23 | android:text="@string/zero" |
21 | 24 | android:textAlignment="viewEnd" |
22 | 25 | android:textColor="@android:color/black" |
23 | | - android:textSize="32sp" /> |
| 26 | + android:textSize="60sp"/> |
24 | 27 | </LinearLayout> |
25 | 28 |
|
26 | 29 | <!--This is for AC, +/-, Remainder, and division--> |
27 | 30 | <LinearLayout |
28 | 31 | android:layout_width="match_parent" |
29 | | - android:layout_height="wrap_content"> |
| 32 | + android:layout_height="wrap_content" |
| 33 | + android:layout_weight="15"> |
30 | 34 |
|
31 | 35 | <Button |
32 | 36 | android:id="@+id/AC" |
33 | | - android:layout_width="0dp" |
34 | | - android:layout_height="wrap_content" |
35 | | - android:layout_weight=".25" |
36 | | - android:text="@string/AC" /> |
| 37 | + android:layout_width="wrap_content" |
| 38 | + android:layout_height="match_parent" |
| 39 | + android:text="@string/AC" |
| 40 | + android:onClick="onClickSigns" |
| 41 | + android:textSize="30sp"/> |
37 | 42 | <Button |
38 | 43 | android:id="@+id/flipSign" |
39 | | - android:layout_width="0dp" |
40 | | - android:layout_height="wrap_content" |
41 | | - android:layout_weight=".25" |
42 | | - android:text="@string/flipSign" /> |
| 44 | + android:layout_width="wrap_content" |
| 45 | + android:layout_height="match_parent" |
| 46 | + android:text="@string/flipSign" |
| 47 | + android:onClick="onClickSigns" |
| 48 | + android:textSize="30sp"/> |
43 | 49 | <Button |
44 | 50 | android:id="@+id/remainder" |
45 | | - android:layout_width="0dp" |
46 | | - android:layout_height="wrap_content" |
47 | | - android:layout_weight=".25" |
48 | | - android:text="@string/remainder" /> |
| 51 | + android:layout_width="wrap_content" |
| 52 | + android:layout_height="match_parent" |
| 53 | + android:text="@string/remainder" |
| 54 | + android:onClick="onClickSigns" |
| 55 | + android:textSize="30sp"/> |
49 | 56 | <Button |
50 | 57 | android:id="@+id/division" |
51 | | - android:layout_width="0dp" |
52 | | - android:layout_height="wrap_content" |
53 | | - android:layout_weight=".25" |
54 | | - android:text="@string/divison" /> </LinearLayout> |
| 58 | + android:layout_width="wrap_content" |
| 59 | + android:layout_height="match_parent" |
| 60 | + android:text="@string/divison" |
| 61 | + android:onClick="onClickSigns" |
| 62 | + android:textSize="30sp"/> </LinearLayout> |
55 | 63 |
|
56 | 64 | <!--This is for 7, 8, 9, and Multiplication--> |
57 | 65 | <LinearLayout |
58 | 66 | android:layout_width="match_parent" |
59 | | - android:layout_height="wrap_content"> |
| 67 | + android:layout_height="wrap_content" |
| 68 | + android:layout_weight="15"> |
60 | 69 |
|
61 | 70 | <Button |
62 | 71 | android:id="@+id/seven" |
63 | | - android:layout_width="0dp" |
64 | | - android:layout_height="wrap_content" |
65 | | - android:layout_weight=".25" |
66 | | - android:text="@string/seven" /> |
| 72 | + android:layout_width="wrap_content" |
| 73 | + android:layout_height="match_parent" |
| 74 | + android:text="@string/seven" |
| 75 | + android:onClick="onClick" |
| 76 | + android:textSize="30sp"/> |
67 | 77 | <Button |
68 | 78 | android:id="@+id/eight" |
69 | | - android:layout_width="0dp" |
70 | | - android:layout_height="wrap_content" |
71 | | - android:layout_weight=".25" |
72 | | - android:text="@string/eight" /> |
| 79 | + android:layout_width="wrap_content" |
| 80 | + android:layout_height="match_parent" |
| 81 | + android:text="@string/eight" |
| 82 | + android:onClick="onClick" |
| 83 | + android:textSize="30sp"/> |
73 | 84 | <Button |
74 | 85 | android:id="@+id/nine" |
75 | | - android:layout_width="0dp" |
76 | | - android:layout_height="wrap_content" |
77 | | - android:layout_weight=".25" |
78 | | - android:text="@string/nine" /> |
| 86 | + android:layout_width="wrap_content" |
| 87 | + android:layout_height="match_parent" |
| 88 | + android:text="@string/nine" |
| 89 | + android:onClick="onClick" |
| 90 | + android:textSize="30sp"/> |
79 | 91 | <Button |
80 | 92 | android:id="@+id/multiplication" |
81 | | - android:layout_width="0dp" |
82 | | - android:layout_height="wrap_content" |
83 | | - android:layout_weight=".25" |
84 | | - android:text="@string/multiplication" /> </LinearLayout> |
| 93 | + android:layout_width="wrap_content" |
| 94 | + android:layout_height="match_parent" |
| 95 | + android:text="@string/multiplication" |
| 96 | + android:onClick="onClickSigns" |
| 97 | + android:textSize="30sp"/> </LinearLayout> |
85 | 98 |
|
86 | 99 | <!--This is for 4, 5, 6, and subtraction--> |
87 | 100 | <LinearLayout |
88 | 101 | android:layout_width="match_parent" |
89 | | - android:layout_height="wrap_content"> |
| 102 | + android:layout_height="wrap_content" |
| 103 | + android:layout_weight="15"> |
90 | 104 |
|
91 | 105 | <Button |
92 | 106 | android:id="@+id/four" |
93 | | - android:layout_width="0dp" |
94 | | - android:layout_height="wrap_content" |
95 | | - android:layout_weight=".25" |
96 | | - android:text="@string/four" /> |
| 107 | + android:layout_width="wrap_content" |
| 108 | + android:layout_height="match_parent" |
| 109 | + android:text="@string/four" |
| 110 | + android:onClick="onClick" |
| 111 | + android:textSize="30sp"/> |
97 | 112 | <Button |
98 | 113 | android:id="@+id/five" |
99 | | - android:layout_width="0dp" |
100 | | - android:layout_height="wrap_content" |
101 | | - android:layout_weight=".25" |
102 | | - android:text="@string/five" /> |
| 114 | + android:layout_width="wrap_content" |
| 115 | + android:layout_height="match_parent" |
| 116 | + android:text="@string/five" |
| 117 | + android:onClick="onClick" |
| 118 | + android:textSize="30sp"/> |
103 | 119 | <Button |
104 | 120 | android:id="@+id/six" |
105 | | - android:layout_width="0dp" |
106 | | - android:layout_height="wrap_content" |
107 | | - android:layout_weight=".25" |
108 | | - android:text="@string/six" /> |
| 121 | + android:layout_width="wrap_content" |
| 122 | + android:layout_height="match_parent" |
| 123 | + android:text="@string/six" |
| 124 | + android:onClick="onClick" |
| 125 | + android:textSize="30sp"/> |
109 | 126 | <Button |
110 | 127 | android:id="@+id/subtraction" |
111 | | - android:layout_width="0dp" |
112 | | - android:layout_height="wrap_content" |
113 | | - android:layout_weight=".25" |
114 | | - android:text="@string/subtraction" /> </LinearLayout> |
| 128 | + android:layout_width="wrap_content" |
| 129 | + android:layout_height="match_parent" |
| 130 | + android:text="@string/subtraction" |
| 131 | + android:onClick="onClickSigns" |
| 132 | + android:textSize="30sp"/> </LinearLayout> |
115 | 133 |
|
116 | 134 | <!--This is for 1, 2, 3, and addition--> |
117 | 135 | <LinearLayout |
118 | 136 | android:layout_width="match_parent" |
119 | | - android:layout_height="wrap_content"> |
| 137 | + android:layout_height="wrap_content" |
| 138 | + android:layout_weight="15"> |
120 | 139 |
|
121 | 140 | <Button |
122 | 141 | android:id="@+id/one" |
123 | | - android:layout_width="0dp" |
124 | | - android:layout_height="wrap_content" |
125 | | - android:layout_weight=".25" |
126 | | - android:text="@string/one" /> |
| 142 | + android:layout_width="wrap_content" |
| 143 | + android:layout_height="match_parent" |
| 144 | + android:text="@string/one" |
| 145 | + android:onClick="onClick" |
| 146 | + android:textSize="30sp"/> |
127 | 147 | <Button |
128 | 148 | android:id="@+id/two" |
129 | | - android:layout_width="0dp" |
130 | | - android:layout_height="wrap_content" |
131 | | - android:layout_weight=".25" |
132 | | - android:text="@string/two" /> |
| 149 | + android:layout_width="wrap_content" |
| 150 | + android:layout_height="match_parent" |
| 151 | + android:text="@string/two" |
| 152 | + android:onClick="onClick" |
| 153 | + android:textSize="30sp"/> |
133 | 154 | <Button |
134 | 155 | android:id="@+id/three" |
135 | | - android:layout_width="0dp" |
136 | | - android:layout_height="wrap_content" |
137 | | - android:layout_weight=".25" |
138 | | - android:text="@string/three" /> |
| 156 | + android:layout_width="wrap_content" |
| 157 | + android:layout_height="match_parent" |
| 158 | + android:text="@string/three" |
| 159 | + android:onClick="onClick" |
| 160 | + android:textSize="30sp"/> |
| 161 | + |
139 | 162 | <Button |
140 | 163 | android:id="@+id/addition" |
141 | | - android:layout_width="0dp" |
142 | | - android:layout_height="wrap_content" |
143 | | - android:layout_weight=".25" |
144 | | - android:text="@string/addition" /> </LinearLayout> |
| 164 | + android:layout_width="wrap_content" |
| 165 | + android:layout_height="match_parent" |
| 166 | + android:onClick="onClickSigns" |
| 167 | + android:text="@string/addition" |
| 168 | + android:textSize="30sp"/> </LinearLayout> |
145 | 169 |
|
146 | 170 | <!--This is for 0, decimal, and equals--> |
147 | 171 | <LinearLayout |
148 | 172 | android:layout_width="match_parent" |
149 | | - android:layout_height="wrap_content"> |
| 173 | + android:layout_height="wrap_content" |
| 174 | + android:layout_weight="15" |
| 175 | + android:weightSum="1"> |
150 | 176 |
|
151 | 177 | <Button |
152 | 178 | android:id="@+id/zero" |
153 | | - android:layout_width="0dp" |
154 | | - android:layout_height="wrap_content" |
155 | | - android:layout_weight=".50" |
156 | | - android:text="@string/zero" /> |
| 179 | + android:layout_width="wrap_content" |
| 180 | + android:layout_height="match_parent" |
| 181 | + android:text="@string/zero" |
| 182 | + android:onClick="onClick" |
| 183 | + android:textSize="30sp" |
| 184 | + android:layout_weight="0.59" /> |
157 | 185 | <Button |
158 | 186 | android:id="@+id/decimal" |
159 | | - android:layout_width="0dp" |
160 | | - android:layout_height="wrap_content" |
161 | | - android:layout_weight=".25" |
162 | | - android:text="@string/decimal" /> |
| 187 | + android:layout_width="wrap_content" |
| 188 | + android:layout_height="match_parent" |
| 189 | + android:text="@string/decimal" |
| 190 | + android:onClick="onClickSigns" |
| 191 | + android:textSize="30sp"/> |
163 | 192 | <Button |
164 | 193 | android:id="@+id/equals" |
165 | | - android:layout_width="0dp" |
166 | | - android:layout_height="wrap_content" |
167 | | - android:layout_weight=".25" |
168 | | - android:text="@string/equals" /> </LinearLayout> |
| 194 | + android:layout_width="wrap_content" |
| 195 | + android:layout_height="match_parent" |
| 196 | + android:text="@string/equals" |
| 197 | + android:onClick="Calculate" |
| 198 | + android:textSize="30sp"/> </LinearLayout> |
169 | 199 |
|
170 | 200 |
|
171 | 201 | </LinearLayout> |
0 commit comments