Skip to content

Commit

Permalink
#2 we have no tmp DB now
Browse files Browse the repository at this point in the history
  • Loading branch information
waj0 committed Apr 17, 2014
1 parent d0d0038 commit 9507ef8
Showing 1 changed file with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,10 @@ public void onClick(View view) {
newFormula.setName(((EditText) findViewById(R.id.formula_name)).getText().toString());
newFormula.setRawFormula(((EditText) findViewById(R.id.formulaText)).getText().toString());


if(getIntent().getBooleanExtra(FormulaListFragment.F_EDIT, false)) {
//TODO update formula and its params in DB.
for (Formula f : MainActivity.valuesFromDB) {
if(f.getId() == newFormula.getId()){
MainActivity.valuesFromDB.remove(f);
break;
}
}
//TODO update formula and its params in DB. and somehow reset list in main activity
}
//TODO add formula and its params to DB.
MainActivity.valuesFromDB.add(newFormula);
//TODO add formula and its params to DB. and somehow reset list in main activity

//TODO display toast
CreationActivity.this.finish();
Expand Down Expand Up @@ -81,18 +73,6 @@ public void onClick(View view) {

Formula fromDB = intent.getParcelableExtra(FormulaListFragment.FORMULA);

/* long id = intent.getLongExtra(FormulaListFragment.F_ID, -1);
if(id == -1){
return;
}
// TODO find formula in DB
for(Formula f : MainActivity.valuesFromDB) {
if(f.getId() == id) {
fromDB = f;
break;
}
}*/

((EditText)findViewById(R.id.formula_name)).setText(fromDB.getName());
((EditText)findViewById(R.id.formulaText)).setText(fromDB.getRawFormula());
for(Parameter p : fromDB.getParams()) {
Expand Down

0 comments on commit 9507ef8

Please sign in to comment.