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