Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
J053Fabi0 authored Jul 13, 2020
2 parents a668bc4 + 9028a86 commit 062f057
Show file tree
Hide file tree
Showing 27 changed files with 165 additions and 333 deletions.
44 changes: 28 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## Change Log

### 0.19.1: July 10, 2020
- Enhancement : Updated Exercise page UI (#130, #131, #132)
- Enhancement : Added units for body measures (#102)
- Bug : Fixed photo import from gallery on Android
- Bug : Fixed program behavior when changing profile
- Bug : Fixed crash after deleting a program that is in progress (#142) (Thank you @sdriv3r)
- Bug : Fixed units not taking the values from settings (#140) (Thank you again @sdriv3r)
- Bug : Fixed brazilian translation (#139) (Thank you again @rffontenelle)
- Bug : Fixed CVS import crash
- Bug : Fixed Bar Graph not at zero
- Bug : Fixed Program template showing in graphs

### 0.19.0.1: June 20, 2020
- Bug : Fixed Brazilian translation (#135) (Thanks @rffontenelle)

Expand Down Expand Up @@ -85,7 +97,7 @@

### 0.16.2 : January 16, 2019
- Enhancement : It's now possible to copy existing records
- Enhancement : Main list now displays last date history
- Enhancement : Main list now displays last date history
- Enhancement : Refactoring for better performance
- Enhancement : Added filtering in exercise page (thanks to @geniusupgrader)

Expand All @@ -97,7 +109,7 @@
- Enhancement : Merged Cardio and Bodybuilding UI
- Enhancement : UI improvement
- Enhancement : Records are now visible on Exercise page
- Bug : Removed case sensitivity for the Exercise list's order
- Bug : Removed case sensitivity for the Exercise list's order
- Bug : Fixed crash on graph when less than 5 reps

### 0.15.3 : October 8, 2018
Expand All @@ -108,7 +120,7 @@

### 0.15.2 : September 19, 2018
- Bug : Fixed intro

### 0.15.1 : September 13, 2018
- Bug : Fixed float issue for profile size
- Bug : Fixed wrong image rotation
Expand All @@ -124,25 +136,25 @@
- Enhancement : Added German language support (Thanks to @EGUltraTM)

### 0.14.5 - June 11, 2018
- Enhancement : Ability to set a picture for the profile
- Enhancement : Crop tool for pictures
- Enhancement : Ability to set a picture for the profile
- Enhancement : Crop tool for pictures
- Enhancement : New Dialog box and Toast, Init optimization

### 0.14.4 - May 19, 2018
- Bug : Fixed issue with Time dialog display on Android 8+
- Bug : Fixed issue with Camera dialog display on Android 8+
- Enhancement : Better exercise refresh
- Enhancement : Automatically close intro after profile creation
- Bug : Fixed issue with Time dialog display on Android 8+
- Bug : Fixed issue with Camera dialog display on Android 8+
- Enhancement : Better exercise refresh
- Enhancement : Automatically close intro after profile creation
- Enhancement : MP3 player hidden by default

### 0.14.3 - May 15, 2018
- Bug : Fixed sum of weight during rest time
- Bug : Fixed some crash on app resume
- Enhancement : Added min and max value for exercises
- Enhancement : Performance enhancement
- Enhancement : Rest countdown vibrates 2 sec before the end
- Enhancement : Added cross in table to delete Weight and Body measurements
- Enhancement : Exercise list with icons and details
- Bug : Fixed sum of weight during rest time
- Bug : Fixed some crash on app resume
- Enhancement : Added min and max value for exercises
- Enhancement : Performance enhancement
- Enhancement : Rest countdown vibrates 2 sec before the end
- Enhancement : Added cross in table to delete Weight and Body measurements
- Enhancement : Exercise list with icons and details
- Enhancement : Current exercise with icons

### 0.14.2 : February 18, 2018
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ dependencies {
// Other
implementation 'com.kovachcode:timePickerWithSeconds:1.0.1'
implementation 'de.psdev.licensesdialog:licensesdialog:2.0.0' //2.0.0
implementation 'com.github.hannesa2:MPAndroidChart:3.0.7'
//implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
//implementation 'com.github.hannesa2:MPAndroidChart:3.0.7'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.astuetz:pagerslidingtabstrip:1.0.1' //DEPRECATED
implementation 'com.ogaclejapan.smarttablayout:library:2.0.0@aar'
implementation 'com.ogaclejapan.smarttablayout:utils-v4:2.0.0@aar'
Expand Down
16 changes: 5 additions & 11 deletions app/src/main/java/com/easyfitness/CountdownDialogbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.easyfitness.DAO.Machine;
import com.easyfitness.enums.ExerciseType;
import com.easyfitness.enums.Unit;
import com.easyfitness.enums.WeightUnit;
import com.easyfitness.utils.AlarmReceiver;
import com.easyfitness.utils.UnitConverter;
Expand Down Expand Up @@ -76,7 +77,7 @@ public static void registerAlarm(Context context, int uniqueId, long triggerAlar
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, uniqueId, intent, 0);
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if (alarmManager != null) {
alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, triggerAlarmAt, pendingIntent);
alarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, triggerAlarmAt, pendingIntent);
}
}

Expand Down Expand Up @@ -104,23 +105,16 @@ protected void onCreate(Bundle savedInstanceState) {
LinearLayout totalExerciseLayout = findViewById(R.id.totalExerciseLayout);
LinearLayout totalWorkoutLayout = findViewById(R.id.totalWorkoutLayout);


progressCircle = findViewById(R.id.donut_progress);
progressCircle.setMax(iRestTime);

exit.setOnClickListener(this);

if (mExerciseType!=ExerciseType.CARDIO) {
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getContext());
int defaultUnit = Integer.valueOf(SP.getString("defaultUnit", "0"));
WeightUnit defaultUnit = SettingsFragment.getDefaultWeightUnit(activity);
DecimalFormat numberFormat = new DecimalFormat("#.##");
if (defaultUnit == WeightUnit.KG.ordinal()) {
totalMachine.setText(numberFormat.format(lTotalMachine) + " " + this.getContext().getResources().getText(R.string.KgUnitLabel));
totalSession.setText(numberFormat.format(lTotalSession) + " " + this.getContext().getResources().getText(R.string.KgUnitLabel));
} else if (defaultUnit == WeightUnit.LBS.ordinal()) {
totalMachine.setText(numberFormat.format(UnitConverter.KgtoLbs(lTotalMachine)) + " " + this.getContext().getResources().getText(R.string.LbsUnitLabel));
totalSession.setText(numberFormat.format(UnitConverter.KgtoLbs(lTotalSession)) + " " + this.getContext().getResources().getText(R.string.LbsUnitLabel));
}
totalMachine.setText(numberFormat.format(UnitConverter.weightConverter(lTotalMachine, Unit.KG, defaultUnit.toUnit())) + " " + defaultUnit.toString());
totalSession.setText(numberFormat.format(UnitConverter.weightConverter(lTotalSession, Unit.KG, defaultUnit.toUnit())) + " " + defaultUnit.toString());
nbSeries.setText(Integer.toString(lNbSerie));
String totalOnExerciseTitle = getContext().getString(R.string.total_on) + " " + mExercise.getName();
totalOnExercise.setText(totalOnExerciseTitle);
Expand Down
6 changes: 1 addition & 5 deletions app/src/main/java/com/easyfitness/DAO/Weight.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ public float getStoredWeight() {
}

public float getWeight(WeightUnit unit) {
float weight = pWeight;
if (unit == WeightUnit.LBS) {
weight = UnitConverter.KgtoLbs(pWeight);
}
return weight;
return UnitConverter.weightConverter(pWeight, WeightUnit.KG, unit);
}

public WeightUnit getStoredUnit() {
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/com/easyfitness/DAO/record/DAOCardio.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,35 @@ public List<GraphData> getFunctionRecords(Profile pProfile, String pMachine,
selectQuery = "SELECT SUM(" + DISTANCE + "), " + DATE + " FROM " + TABLE_NAME
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
} else if (pFunction == DAOCardio.DURATION_FCT) {
selectQuery = "SELECT SUM(" + DURATION + ") , " + DATE + " FROM "
+ TABLE_NAME
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
} else if (pFunction == DAOCardio.SPEED_FCT) {
selectQuery = "SELECT SUM(" + DISTANCE + ") / SUM(" + DURATION + ")," + DATE + " FROM "
+ TABLE_NAME
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
} else if (pFunction == DAOCardio.MAXDISTANCE_FCT) {
selectQuery = "SELECT MAX(" + DISTANCE + ") , " + DATE + " FROM "
+ TABLE_NAME
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
}
Expand Down
23 changes: 18 additions & 5 deletions app/src/main/java/com/easyfitness/DAO/record/DAOFonte.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public List<GraphData> getBodyBuildingFunctionRecords(Profile pProfile, String p
+ WEIGHT + "), " + DATE + " FROM " + TABLE_NAME
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
} else if (pFunction == DAOFonte.MAX5_FCT) {
Expand All @@ -80,6 +82,8 @@ public List<GraphData> getBodyBuildingFunctionRecords(Profile pProfile, String p
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + REPS + ">=5"
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
} else if (pFunction == DAOFonte.MAX1_FCT) {
Expand All @@ -88,13 +92,17 @@ public List<GraphData> getBodyBuildingFunctionRecords(Profile pProfile, String p
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + REPS + ">=1"
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
} else if (pFunction == DAOFonte.NBSERIE_FCT) {
selectQuery = "SELECT count(" + KEY + ") , " + DATE + " FROM "
+ TABLE_NAME
+ " WHERE " + EXERCISE + "=\"" + pMachine + "\""
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal()
+ " GROUP BY " + DATE
+ " ORDER BY date(" + DATE + ") ASC";
}
Expand Down Expand Up @@ -155,7 +163,8 @@ public int getNbSeries(Date pDate, String pMachine, Profile pProfile) {
String selectQuery = "SELECT SUM(" + SETS + ") FROM " + TABLE_NAME
+ " WHERE " + DATE + "=\"" + lDate + "\" AND " + EXERCISE_KEY + "=" + machine_key
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal();
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal();
mCursor = db.rawQuery(selectQuery, null);

// looping through all rows and adding to list
Expand Down Expand Up @@ -194,7 +203,8 @@ public float getTotalWeightMachine(Date pDate, String pMachine, Profile pProfile
String selectQuery = "SELECT " + SETS + ", " + WEIGHT + ", " + REPS + " FROM " + TABLE_NAME
+ " WHERE " + DATE + "=\"" + lDate + "\" AND " + EXERCISE_KEY + "=" + machine_key
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal();
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal();
mCursor = db.rawQuery(selectQuery, null);

// looping through all rows and adding to list
Expand Down Expand Up @@ -230,7 +240,8 @@ public float getTotalWeightSession(Date pDate, Profile pProfile) {
String selectQuery = "SELECT " + SETS + ", " + WEIGHT + ", " + REPS + " FROM " + TABLE_NAME
+ " WHERE " + DATE + "=\"" + lDate + "\""
+ " AND " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal();
+ " AND " + TEMPLATE_RECORD_STATUS + "<" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal();
mCursor = db.rawQuery(selectQuery, null);

// looping through all rows and adding to list
Expand Down Expand Up @@ -260,7 +271,8 @@ public Weight getMax(Profile p, Machine m) {
// Select All Machines
String selectQuery = "SELECT MAX(" + WEIGHT + "), " + WEIGHT_UNIT + " FROM " + TABLE_NAME
+ " WHERE " + PROFILE_KEY + "=" + p.getId() + " AND " + EXERCISE_KEY + "=" + m.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal();
+ " AND " + TEMPLATE_RECORD_STATUS + "<" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal();
mCursor = db.rawQuery(selectQuery, null);

// looping through all rows and adding to list
Expand All @@ -287,7 +299,8 @@ public Weight getMin(Profile p, Machine m) {
// Select All Machines
String selectQuery = "SELECT MIN(" + WEIGHT + "), " + WEIGHT_UNIT + " FROM " + TABLE_NAME
+ " WHERE " + PROFILE_KEY + "=" + p.getId() + " AND " + EXERCISE_KEY + "=" + m.getId()
+ " AND " + TEMPLATE_RECORD_STATUS + "!=" + ProgramRecordStatus.PENDING.ordinal();
+ " AND " + TEMPLATE_RECORD_STATUS + "<" + ProgramRecordStatus.PENDING.ordinal()
+ " AND " + RECORD_TYPE + "!=" + RecordType.TEMPLATE_TYPE.ordinal();
mCursor = db.rawQuery(selectQuery, null);

// looping through all rows and adding to list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public Cursor getTop3DatesRecords(Profile pProfile) {

selectQuery = "SELECT * FROM " + TABLE_NAME
+ " WHERE " + PROFILE_KEY + "=" + pProfile.getId()
+ " AND " + DATE + " IN (SELECT DISTINCT " + DATE + " FROM " + TABLE_NAME + " WHERE " + PROFILE_KEY + "=" + pProfile.getId() + " ORDER BY " + DATE + " DESC LIMIT 3)"
+ " AND " + DATE + " IN (SELECT DISTINCT " + DATE + " FROM " + TABLE_NAME + " WHERE " + PROFILE_KEY + "=" + pProfile.getId() + " AND " + TEMPLATE_KEY + "=-1" + " ORDER BY " + DATE + " DESC LIMIT 3)"
+ " AND " + TEMPLATE_KEY + "=-1"
+ " ORDER BY " + DATE + " DESC," + KEY + " DESC";

Expand Down
Loading

0 comments on commit 062f057

Please sign in to comment.