mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-06 03:23:07 +02:00
Change code style about code of calorie calculation.
This commit is contained in:
@@ -89,8 +89,8 @@ public interface TracksColumns extends BaseColumns {
|
||||
// The owner of the shared with me track
|
||||
public static final String SHAREDOWNER = "sharedOwner";
|
||||
|
||||
// Calorie expenditure of the track
|
||||
public static final String CALORIE = "calories";
|
||||
// Calorie burned of the track
|
||||
public static final String CALORIE = "calorie";
|
||||
|
||||
public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" // table
|
||||
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " // id
|
||||
@@ -124,7 +124,7 @@ public interface TracksColumns extends BaseColumns {
|
||||
+ MODIFIEDTIME + " INTEGER, " // modified time
|
||||
+ SHAREDWITHME + " INTEGER, " // shared with me
|
||||
+ SHAREDOWNER + " STRING, " // shared owner
|
||||
+ CALORIE + " INTEGER);"; // calories
|
||||
+ CALORIE + " INTEGER);"; // calorie
|
||||
|
||||
public static final String[] COLUMNS = { _ID, // id
|
||||
NAME, // name
|
||||
@@ -157,7 +157,7 @@ public interface TracksColumns extends BaseColumns {
|
||||
MODIFIEDTIME, // modified time
|
||||
SHAREDWITHME, // shared with me
|
||||
SHAREDOWNER,// shared owner
|
||||
CALORIE }; // calories
|
||||
CALORIE }; // calorie
|
||||
|
||||
public static final byte[] COLUMN_TYPES = { ContentTypeIds.LONG_TYPE_ID, // id
|
||||
ContentTypeIds.STRING_TYPE_ID, // name
|
||||
@@ -190,6 +190,6 @@ public interface TracksColumns extends BaseColumns {
|
||||
ContentTypeIds.LONG_TYPE_ID, // modified time
|
||||
ContentTypeIds.BOOLEAN_TYPE_ID, // shared with me
|
||||
ContentTypeIds.STRING_TYPE_ID, // shared owner
|
||||
ContentTypeIds.INT_TYPE_ID // calories
|
||||
ContentTypeIds.INT_TYPE_ID // calorie
|
||||
};
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ public class TripStatistics implements Parcelable {
|
||||
// The min and max grade seen on this trip.
|
||||
private final ExtremityMonitor gradeExtremities = new ExtremityMonitor();
|
||||
|
||||
// The calorie expenditure of current track.
|
||||
private double calorie = 0;
|
||||
// The calorie of current track.
|
||||
private double calorie;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
@@ -493,7 +493,7 @@ public class TripStatistics implements Parcelable {
|
||||
+ "; Max Longitude: " + getRightDegrees() + "; Max Speed: " + getMaxSpeed()
|
||||
+ "; Min Elevation: " + getMinElevation() + "; Max Elevation: " + getMaxElevation()
|
||||
+ "; Elevation Gain: " + getTotalElevationGain() + "; Min Grade: " + getMinGrade()
|
||||
+ "; Max Grade: " + getMaxGrade() + "; Calorie expenditure: " + getCalorie()
|
||||
+ "; Max Grade: " + getMaxGrade() + "; Calorie: " + getCalorie()
|
||||
+ "}";
|
||||
}
|
||||
|
||||
@@ -531,8 +531,7 @@ public class TripStatistics implements Parcelable {
|
||||
double maxGrade = source.readDouble();
|
||||
data.gradeExtremities.set(minGrade, maxGrade);
|
||||
|
||||
double calorie = source.readDouble();
|
||||
data.setCalorie(calorie);
|
||||
data.calorie = source.readDouble();
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -576,7 +575,7 @@ public class TripStatistics implements Parcelable {
|
||||
/**
|
||||
* Adds calorie value.
|
||||
*
|
||||
* @param calorieAdded
|
||||
* @param calorieAdded add the value to the total calorie
|
||||
*/
|
||||
public void addCalorie(double calorieAdded) {
|
||||
this.calorie += calorieAdded;
|
||||
@@ -584,9 +583,11 @@ public class TripStatistics implements Parcelable {
|
||||
|
||||
/**
|
||||
* Sets calorie value.
|
||||
*
|
||||
* @param calorie the new value of calorie
|
||||
*/
|
||||
public void setCalorie(double newCalorie) {
|
||||
calorie = newCalorie;
|
||||
public void setCalorie(double calorie) {
|
||||
this.calorie = calorie;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user