|
@@ -144,6 +144,15 @@ public class CaculatorLayout extends LinearLayout implements View.OnClickListene
|
144
|
144
|
this.beizhu.setText(beizhu);
|
145
|
145
|
}
|
146
|
146
|
|
|
147
|
+ public void setShowNumText(String shownumtext){
|
|
148
|
+ this.shownumtext = shownumtext;
|
|
149
|
+ }
|
|
150
|
+
|
|
151
|
+ public void setCompleteNumtext(String completenumtext){
|
|
152
|
+ this.completenumtext = completenumtext;
|
|
153
|
+ }
|
|
154
|
+
|
|
155
|
+
|
147
|
156
|
|
148
|
157
|
@Override
|
149
|
158
|
public void onClick(View view) {
|
|
@@ -274,7 +283,14 @@ public class CaculatorLayout extends LinearLayout implements View.OnClickListene
|
274
|
283
|
}
|
275
|
284
|
|
276
|
285
|
}else {
|
|
286
|
+
|
|
287
|
+ String sumStr = mNumText.getText().toString().trim();
|
|
288
|
+ double sumDouble = Double.parseDouble(sumStr);
|
|
289
|
+ if(sumDouble==0){
|
|
290
|
+ return;
|
|
291
|
+ }
|
277
|
292
|
sum.complete();
|
|
293
|
+
|
278
|
294
|
}
|
279
|
295
|
return;
|
280
|
296
|
case R.id.calculator_add_btn:
|
|
@@ -333,6 +349,8 @@ public class CaculatorLayout extends LinearLayout implements View.OnClickListene
|
333
|
349
|
}
|
334
|
350
|
|
335
|
351
|
|
|
352
|
+ System.out.println(all);
|
|
353
|
+
|
336
|
354
|
if(!all.endsWith(INPUT_ADD)&&!all.endsWith(INPUT_SUB)){
|
337
|
355
|
all = all.substring(0,all.length() - 1);
|
338
|
356
|
|