提交 e00dd656 编写于 作者: Sugar_chestnut03's avatar Sugar_chestnut03

Replace BaseRecordFragment.java

上级 a109c329
......@@ -24,6 +24,8 @@ import com.example.jizhangben.db.AccountBean;
import com.example.jizhangben.db.DBManager;
import com.example.jizhangben.db.TypeBean;
import utils.KeyBoardUntils;
import utils.SelectTimeDialog;
import utils.BeiZhuDialog;
import java.text.SimpleDateFormat;
......@@ -143,4 +145,49 @@ public abstract class BaseRecordFragment extends Fragment implements View.OnClic
/* 让子类一定要重写这个方法*/
public void saveAccountToDB(){
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.frag_record_tv_time:
showTimeDialog();
break;
case R.id.frag_record_tv_beizhu:
showBZDialog();
break;
}
}
/* 弹出显示时间的对话框*/
private void showTimeDialog() {
SelectTimeDialog dialog = new SelectTimeDialog(getContext());
dialog.show();
//设定确定按钮被点击了的监听器
dialog.setOnEnsureListener(new SelectTimeDialog.OnEnsureListener() {
@Override
public void onEnsure(String time, int year, int month, int day) {
timeTv.setText(time);
accountBean.setTime(time);
accountBean.setYear(year);
accountBean.setMonth(month);
accountBean.setDay(day);
}
});
}
/* 弹出备注对话框*/
public void showBZDialog(){
final BeiZhuDialog dialog = new BeiZhuDialog(getContext());
dialog.show();
dialog.setDialogSize();
dialog.setOnEnsureListener(new BeiZhuDialog.OnEnsureListener() {
@Override
public void onEnsure() {
String msg = dialog.getEditText();
if (!TextUtils.isEmpty(msg)) {
beizhuTv.setText(msg);
accountBean.setBeizhu(msg);
}
dialog.cancel();
}
});
}
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册