e лет назад: 6
Родитель
Сommit
19b9476acf

+ 3 - 0
app/src/main/java/com/kuxuan/moneynote/ui/activitys/account/AccountActivity.java

@@ -208,6 +208,8 @@ public class AccountActivity extends MVPFragmentActivity<AccountPresenter, Accou
208 208
         if (numNumber != null) {
209 209
             num.setText(numNumber);
210 210
             keybord.setNumText(numNumber);
211
+            keybord.setShowNumText(numNumber);
212
+            keybord.setCompleteNumtext(numNumber);
211 213
         }
212 214
         //编辑页跳转过来用到
213 215
         isEdit = intent.getBooleanExtra(ISEDIT, false);
@@ -448,6 +450,7 @@ public class AccountActivity extends MVPFragmentActivity<AccountPresenter, Accou
448 450
 
449 451
     @Override
450 452
     public void complete() {
453
+
451 454
         if (COMPLETE.equals(mResult.getText())) {
452 455
             if (isEdit) {
453 456
                 if (category_id.equals("0")) {

+ 18 - 0
app/src/main/java/com/kuxuan/moneynote/ui/weight/CaculatorLayout.java

@@ -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