3 Commits 6540ca9371 ... 75ddfa27cc

Author SHA1 Message Date
  e 75ddfa27cc Merge branch 'MoneyNote3.0' of http://git.quyaqu.com/xieshengqi/MoneyMoreMoreNote into MoneyNote3.0 6 years ago
  e d60b3975b4 提交数据库 6 years ago
  e 19b9476acf 提交数据库 6 years ago

+ 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")) {

+ 21 - 0
app/src/main/java/com/kuxuan/moneynote/ui/activitys/bill/BillActivity.java

@@ -12,11 +12,13 @@ import android.widget.Toast;
12 12
 import com.kuxuan.moneynote.R;
13 13
 import com.kuxuan.moneynote.base.mvpbase.MVPFragmentActivity;
14 14
 import com.kuxuan.moneynote.json.BillJson;
15
+import com.kuxuan.moneynote.json.BillJsonList;
15 16
 import com.kuxuan.moneynote.utils.PickerUtil;
16 17
 import com.kuxuan.moneynote.utils.TextSetUtil;
17 18
 import com.umeng.analytics.MobclickAgent;
18 19
 
19 20
 import java.util.Calendar;
21
+import java.util.List;
20 22
 
21 23
 import butterknife.Bind;
22 24
 import cn.addapp.pickers.picker.NumberPicker;
@@ -152,4 +154,23 @@ public class BillActivity extends MVPFragmentActivity<BillPresenter, BillModel>
152 154
         TextSetUtil.setTextForMoey("0",mIncomeText);
153 155
         TextSetUtil.setTextForMoey("0",mPayText);
154 156
     }
157
+
158
+    @Override
159
+    public void setOffLineBillData(List<BillJsonList> billJsonLists) {
160
+
161
+        double income_Sum=0;
162
+        double pay_Sum=0;
163
+        double balance_Sum =0;
164
+
165
+        for(int i=0;i<billJsonLists.size();i++){
166
+            income_Sum = Double.parseDouble(billJsonLists.get(i).getIncome())+income_Sum;
167
+            pay_Sum = Double.parseDouble(billJsonLists.get(i).getPay())+pay_Sum;
168
+        }
169
+        balance_Sum = income_Sum - pay_Sum;
170
+
171
+        TextSetUtil.setTextForMoey(TextSetUtil.formatFloatNumber(balance_Sum),mBalanceText);
172
+        TextSetUtil.setTextForMoey(TextSetUtil.formatFloatNumber(income_Sum),mIncomeText);
173
+        TextSetUtil.setTextForMoey(TextSetUtil.formatFloatNumber(pay_Sum),mPayText);
174
+
175
+    }
155 176
 }

+ 4 - 0
app/src/main/java/com/kuxuan/moneynote/ui/activitys/bill/BillContract.java

@@ -7,9 +7,12 @@ import com.kuxuan.moneynote.base.mvpbase.BaseModel;
7 7
 import com.kuxuan.moneynote.base.mvpbase.BasePresent;
8 8
 import com.kuxuan.moneynote.base.mvpbase.BaseView;
9 9
 import com.kuxuan.moneynote.json.BillJson;
10
+import com.kuxuan.moneynote.json.BillJsonList;
10 11
 import com.kuxuan.moneynote.json.Time;
11 12
 import com.kuxuan.moneynote.listener.MVPListener;
12 13
 
14
+import java.util.List;
15
+
13 16
 /**
14 17
  * @author HFRX hfrx1314@qq.com
15 18
  * @version 1.0.0
@@ -29,6 +32,7 @@ public interface BillContract {
29 32
         void setData();
30 33
 
31 34
 
35
+        void setOffLineBillData(List<BillJsonList> billJsonLists);
32 36
     }
33 37
 
34 38
 

+ 1 - 0
app/src/main/java/com/kuxuan/moneynote/ui/activitys/bill/BillPresenter.java

@@ -107,6 +107,7 @@ public class BillPresenter extends BillContract.BillPresent {
107 107
 
108 108
         }
109 109
         mAdapter.setNewData(billJsonLists);
110
+       view.setOffLineBillData(billJsonLists);
110 111
 
111 112
     }
112 113
 }

+ 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
 

+ 2 - 2
app/src/main/java/com/kuxuan/moneynote/utils/TextSetUtil.java

@@ -44,9 +44,9 @@ public class TextSetUtil {
44 44
      */
45 45
     public static void setTextForMoey(String text, TextView textView) {
46 46
         String[] split = null;
47
-        String replace = text.replace("-", "");
47
+//        String replace = text.replace("-", "");
48 48
         try {
49
-            split = replace.split("\\.");
49
+            split = text.split("\\.");
50 50
             TextParser textParser = new TextParser();
51 51
             textParser.append(split[0], DisplayUtil.dip2px(16), Color.BLACK);
52 52
             textParser.append("." + split[1], DisplayUtil.dip2px(12), Color.parseColor("#262626"));