Skip to content

Commit

Permalink
Fixed (#252). Crash due to removed templates from program.
Browse files Browse the repository at this point in the history
  • Loading branch information
brodeurlv committed Feb 22, 2022
1 parent b1bdd20 commit 950b2e3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Change Log

### 0.20.5.1: February 22, 2022
- Bug: Fixed start issue (#252)

### 0.20.5: February 13, 2022
- Enhancement: Changes csv column names. Please refer to github WIKI documentation for details (#49, #209)
- Enhancement: Added program and program templates to csv export (#228)
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.easyfitness"
minSdkVersion 21
targetSdkVersion 30
versionCode 62
versionName "0.20.5"
versionCode 63
versionName "0.20.5.1"
vectorDrawables.useSupportLibrary true
}

Expand Down
20 changes: 11 additions & 9 deletions app/src/main/java/com/easyfitness/DAO/DatabaseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,17 @@ public void copyTemplateValues(SQLiteDatabase db) {
for (Record record:recordList) {
if (record.getProgramId() != -1 && record.getRecordType()== RecordType.PROGRAM_RECORD) {
Record templateRecord = daoRecord.getRecord(db, record.getProgramId());
record.setTemplateSets(templateRecord.getSets());
record.setTemplateReps(templateRecord.getReps());
record.setTemplateWeight(templateRecord.getWeightInKg());
record.setTemplateWeightUnit(templateRecord.getWeightUnit());
record.setTemplateSeconds(templateRecord.getSeconds());
record.setTemplateDistance(templateRecord.getDistanceInKm());
record.setTemplateDistanceUnit(templateRecord.getDistanceUnit());
record.setTemplateDuration(templateRecord.getDuration());
daoRecord.updateRecord(db, record);
if (templateRecord!=null) {
record.setTemplateSets(templateRecord.getSets());
record.setTemplateReps(templateRecord.getReps());
record.setTemplateWeight(templateRecord.getWeightInKg());
record.setTemplateWeightUnit(templateRecord.getWeightUnit());
record.setTemplateSeconds(templateRecord.getSeconds());
record.setTemplateDistance(templateRecord.getDistanceInKm());
record.setTemplateDistanceUnit(templateRecord.getDistanceUnit());
record.setTemplateDuration(templateRecord.getDuration());
daoRecord.updateRecord(db, record);
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values/about.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_version" translatable="false">0.20.5</string>
<string name="app_version" translatable="false">0.20.5.1</string>
<string name="database_version_label" translatable="false">Database version: </string>
<string name="copyright" translatable="false">Copyright(c) 2022 - Charles Combes - All rights reserved.</string>
<string name="bsd3" translatable="false">BSD 3</string>
Expand All @@ -11,6 +11,8 @@
<string name="email_url" translatable="false">[email protected]</string>
<string name="revision_history_label" translatable="false">Revision History:</string>
<string name="revision_history" translatable="false">\n
0.20.5.1: February 22, 2022\n
\t- Bug: Fixed start issue (#252)\n
0.20.5: February 6, 2022\n
\t- Enhancement: Changes csv column names. Please refer to github WIKI documentation for details (#49, #209)\n
\t- Enhancement: Added program and program templates to csv export (#228) \n
Expand Down

0 comments on commit 950b2e3

Please sign in to comment.