今日任务:
- 通过昨天反应出来的问题,开会进行讨论,制定任务卡。
- 继续观察网友提出的问题,有利于后期的维护。
增加删除代码:
package com.yuukidach.ucount;
import android.content.res.Resources;
import org.litepal.crud.DataSupport;
public class IOItem extends DataSupport {
public final int TYPE_COST = -1;
public final int TYPE_EARN = 1;
private int id;
private int type; // 收入还会支出
private int mId;
private double money;
private String name;
private String description;
private String timeStamp;
private String srcName; // 项目资源名称
public IOItem () {}
public IOItem(String srcName, String name) {
this.srcName = srcName;
this.name = name;
}
// 构造函数(无具体描述)
public IOItem(String srcName, int type, double money, String name) {
this.srcName = srcName;
this.money = money;
this.type = type;
this.name = name;
}
// 构造函数(有具体描述)
public IOItem(String srcName, int type, double money, String name, String description) {
this.money = money;
this.type = type;
this.srcName = srcName;
this.name = name;
this.description = description;
}
public double getMoney() { return money; }
public int getType() { return type; }
public String getName() { return name; }
public String getDescription() { return description; }
public String getTimeStamp() { return timeStamp; }
public int getmId() { return mId; }
public String getSrcName() { return srcName; }
public int getId() { return id; }
// 设定属性
public void setMoney(double money) { this.money = money; }
public void setType(int type) { this.type = type; }
public void setName(String name) { this.name = name; }
public void setDescription(String description) { this.description = description; }
public void setTimeStamp(String timeStamp) { this.timeStamp = timeStamp; }
public void setmId(int mId) { this.mId = mId; }
public void setSrcName(String srcName) { this.srcName = srcName; }
// 返回图片资源的id
public int getSrcId() {
Resources resources = MainActivity.resources;
return resources.getIdentifier(srcName, "drawable", MainActivity.PACKAGE_NAME);
}
}