mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-10 21:13:11 +02:00
Change code style about code of calorie calculation.
This commit is contained in:
@@ -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