Browse Source

bug修改,代码混淆

Xieshengqi 7 years ago
parent
commit
64058f4e54

+ 12 - 2
app/src/main/java/com/kuxuan/moneynote/ui/activitys/account/AccountActivity.java

13
 import com.kuxuan.moneynote.R;
13
 import com.kuxuan.moneynote.R;
14
 import com.kuxuan.moneynote.base.mvpbase.MVPFragmentActivity;
14
 import com.kuxuan.moneynote.base.mvpbase.MVPFragmentActivity;
15
 import com.kuxuan.moneynote.common.Constant;
15
 import com.kuxuan.moneynote.common.Constant;
16
+import com.kuxuan.moneynote.json.CategoryList;
16
 import com.kuxuan.moneynote.json.netbody.BillBody;
17
 import com.kuxuan.moneynote.json.netbody.BillBody;
17
 import com.kuxuan.moneynote.ui.activitys.eventbus.RefreshEvent;
18
 import com.kuxuan.moneynote.ui.activitys.eventbus.RefreshEvent;
18
 import com.kuxuan.moneynote.ui.weight.CaculatorLayout;
19
 import com.kuxuan.moneynote.ui.weight.CaculatorLayout;
67
     public static final String ICON_URL = "icon_url";
68
     public static final String ICON_URL = "icon_url";
68
     private static final String EQUAL = "=";
69
     private static final String EQUAL = "=";
69
     private static final String COMPLETE = "完成";
70
     private static final String COMPLETE = "完成";
71
+    public static final String NAME = "name";
70
     private static final int LENGTH_2 = 2;
72
     private static final int LENGTH_2 = 2;
71
 
73
 
72
     private String icon_url;
74
     private String icon_url;
96
 
98
 
97
     String daytime;
99
     String daytime;
98
 
100
 
101
+
102
+    /**
103
+     * 类别名字
104
+     */
105
+    private String name;
106
+
99
     /**
107
     /**
100
      * @param context
108
      * @param context
101
      * @param num     金额
109
      * @param num     金额
221
 
229
 
222
 
230
 
223
     @Override
231
     @Override
224
-    public void click(String category_id, int type, String icon_url) {
232
+    public void click(String category_id, int type, String icon_url, CategoryList categoryList) {
225
         this.category_id = category_id;
233
         this.category_id = category_id;
226
         this.mType = type;
234
         this.mType = type;
227
         this.icon_url = icon_url;
235
         this.icon_url = icon_url;
236
+        this.name = categoryList.getName();
228
         keybord.setVisibility(View.VISIBLE);
237
         keybord.setVisibility(View.VISIBLE);
229
     }
238
     }
230
 
239
 
285
         intent.putExtra(TIME, billBody.getTime());
294
         intent.putExtra(TIME, billBody.getTime());
286
         intent.putExtra(TYPE, billBody.getType());
295
         intent.putExtra(TYPE, billBody.getType());
287
         intent.putExtra(DEMO, billBody.getDemo());
296
         intent.putExtra(DEMO, billBody.getDemo());
297
+        intent.putExtra(NAME, name);
288
         intent.putExtra(ICON_URL, icon_url);
298
         intent.putExtra(ICON_URL, icon_url);
289
         setResult(Constant.Code_Request.RESULTCODE, intent);
299
         setResult(Constant.Code_Request.RESULTCODE, intent);
290
         EventBus.getDefault().post(new RefreshEvent());
300
         EventBus.getDefault().post(new RefreshEvent());
306
     public void complete() {
316
     public void complete() {
307
         if (COMPLETE.equals(mResult.getText())) {
317
         if (COMPLETE.equals(mResult.getText())) {
308
             if (isEdit) {
318
             if (isEdit) {
309
-                if(category_id.equals("0")){
319
+                if (category_id.equals("0")) {
310
                     return;
320
                     return;
311
                 }
321
                 }
312
                 BillBody billBody = new BillBody(category_id, mType, num.getText().toString(), getTime(daytime), mNumEdit.getText().toString(), bill_id);
322
                 BillBody billBody = new BillBody(category_id, mType, num.getText().toString(), getTime(daytime), mNumEdit.getText().toString(), bill_id);

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

56
                     }
56
                     }
57
                 }
57
                 }
58
                 mAdapter.notifyDataSetChanged();
58
                 mAdapter.notifyDataSetChanged();
59
-                mClickListener.click(mCategoryList.get(position).getId(), mCategoryList.get(position).getType(),mCategoryList.get(position).getIcon());
59
+                mClickListener.click(mCategoryList.get(position).getId(), mCategoryList.get(position).getType(),mCategoryList.get(position).getIcon(),mCategoryList.get(position));
60
             }
60
             }
61
         });
61
         });
62
 
62
 
131
             }
131
             }
132
         }
132
         }
133
         mAdapter.notifyDataSetChanged();
133
         mAdapter.notifyDataSetChanged();
134
-        mClickListener.click(account.getId(), account.getType(),account.getIcon());
134
+        mClickListener.click(account.getId(), account.getType(),account.getIcon(),account);
135
     }
135
     }
136
 
136
 
137
     interface ClickListener {
137
     interface ClickListener {
138
-        void click(String category_id, int type,String icon_url);
138
+        void click(String category_id, int type,String icon_url,CategoryList categoryList);
139
     }
139
     }
140
 
140
 
141
 }
141
 }

+ 10 - 3
app/src/main/java/com/kuxuan/moneynote/ui/activitys/edit/EditBillActivity.java

2
 
2
 
3
 import android.content.Intent;
3
 import android.content.Intent;
4
 import android.os.Bundle;
4
 import android.os.Bundle;
5
+import android.text.TextUtils;
5
 import android.view.View;
6
 import android.view.View;
6
 import android.widget.TextView;
7
 import android.widget.TextView;
7
 
8
 
96
             activityEditMoney.setText(dayDataEntity.getAccount().replace("-", ""));
97
             activityEditMoney.setText(dayDataEntity.getAccount().replace("-", ""));
97
             activityEditType.setText("支出");
98
             activityEditType.setText("支出");
98
         }
99
         }
99
-        GlideUtil.setImageWithNoCache(this,dayDataEntity.getSmall_icon(),getTitleView().getEdit_image());
100
+        GlideUtil.setImageWithNoCache(this, dayDataEntity.getSmall_icon(), getTitleView().getEdit_image());
100
         activityEditBeizhu.setText(dayDataEntity.getDemo());
101
         activityEditBeizhu.setText(dayDataEntity.getDemo());
101
         getTitleView().getEdit_text().setText(dayDataEntity.getName());
102
         getTitleView().getEdit_text().setText(dayDataEntity.getName());
102
         getTitleView().getEdit_image().setImageResource(R.mipmap.category_custom_selected);
103
         getTitleView().getEdit_image().setImageResource(R.mipmap.category_custom_selected);
115
         activityEditTime.setText(dayDataEntity.getDay_type());
116
         activityEditTime.setText(dayDataEntity.getDay_type());
116
         activityEditBeizhu.setText(dayDataEntity.getDemo());
117
         activityEditBeizhu.setText(dayDataEntity.getDemo());
117
         getTitleView().getEdit_text().setText(dayDataEntity.getName());
118
         getTitleView().getEdit_text().setText(dayDataEntity.getName());
118
-        getTitleView().getEdit_image().setImageResource(R.mipmap.category_custom_selected);
119
+        GlideUtil.setImageWithNoCache(this, dayDataEntity.getSmall_icon(), getTitleView().getEdit_image());
120
+//        getTitleView().getEdit_image().setImageResource(R.mipmap.category_custom_selected);
119
     }
121
     }
120
 
122
 
121
     @OnClick({R.id.activity_edit_edit_text, R.id.activity_edit_delete_text})
123
     @OnClick({R.id.activity_edit_edit_text, R.id.activity_edit_delete_text})
127
                 intent.putExtra(AccountActivity.NUM, dayDataEntity.getAccount());
129
                 intent.putExtra(AccountActivity.NUM, dayDataEntity.getAccount());
128
                 intent.putExtra(AccountActivity.BILL_ID, dayDataEntity.getId() + "");
130
                 intent.putExtra(AccountActivity.BILL_ID, dayDataEntity.getId() + "");
129
                 intent.putExtra(AccountActivity.TYPE, dayDataEntity.getType());
131
                 intent.putExtra(AccountActivity.TYPE, dayDataEntity.getType());
130
-                intent.putExtra(AccountActivity.ID, dayDataEntity.getCategory_id()+"");
132
+                intent.putExtra(AccountActivity.ID, dayDataEntity.getCategory_id() + "");
131
                 intent.putExtra(AccountActivity.TIME, timeData);
133
                 intent.putExtra(AccountActivity.TIME, timeData);
132
                 intent.putExtra(AccountActivity.DEMO, dayDataEntity.getDemo());
134
                 intent.putExtra(AccountActivity.DEMO, dayDataEntity.getDemo());
133
                 intent.putExtra(AccountActivity.ISEDIT, true);
135
                 intent.putExtra(AccountActivity.ISEDIT, true);
216
                     dayDataEntity.setSmall_icon(data.getStringExtra(AccountActivity.ICON_URL));
218
                     dayDataEntity.setSmall_icon(data.getStringExtra(AccountActivity.ICON_URL));
217
                     if (type != -1)
219
                     if (type != -1)
218
                         dayDataEntity.setType(type);
220
                         dayDataEntity.setType(type);
221
+
222
+
223
+                    String name = data.getStringExtra(AccountActivity.NAME);
224
+                    if (!TextUtils.isEmpty(name))
225
+                        dayDataEntity.setName(name);
219
                     initNewData();
226
                     initNewData();
220
                 }
227
                 }
221
             }
228
             }

+ 2 - 2
app/src/main/java/com/kuxuan/moneynote/ui/fragments/reportsingle/ReportSingleFragment.java

169
                         Intent intent = new Intent(getActivity(), ReportChartActivity.class);
169
                         Intent intent = new Intent(getActivity(), ReportChartActivity.class);
170
                         intent.putExtra(ReportChartActivity.CATROGY_ID, category_id);
170
                         intent.putExtra(ReportChartActivity.CATROGY_ID, category_id);
171
                         intent.putExtra(ReportChartActivity.MONEY_TYPE, mType);
171
                         intent.putExtra(ReportChartActivity.MONEY_TYPE, mType);
172
-                        intent.putExtra(ReportChartActivity.TITLE, title_text);
173
-                        intent.putExtra(ReportChartActivity.RADIO_TYPE, radio_type);
172
+                        intent.putExtra(ReportChartActivity.TITLE, mPresenter.getTitle_text());
173
+                        intent.putExtra(ReportChartActivity.RADIO_TYPE, mPresenter.getType());
174
                         intent.putExtra(ReportChartActivity.CHARTTYPE, ChartLayout.YUANHUAN);
174
                         intent.putExtra(ReportChartActivity.CHARTTYPE, ChartLayout.YUANHUAN);
175
                         startActivity(intent);
175
                         startActivity(intent);
176
                     }
176
                     }