mirror of
https://github.com/russok/FitoTrack.git
synced 2025-10-28 00:02:11 -07:00
Fix bugs in Manual workout adding
- Save end time correctly - Show hint 'comment' instead of 'custom'
This commit is contained in:
parent
8665d5ca14
commit
289e25949f
@ -96,7 +96,7 @@ public class EnterWorkoutActivity extends InformationActivity implements SelectW
|
||||
durationLine.lineRoot.setOnClickListener(v -> showDurationSelection());
|
||||
durationTextView = durationLine.value;
|
||||
|
||||
addTitle(getString(R.string.custom));
|
||||
addTitle(getString(R.string.comment));
|
||||
|
||||
commentEditText = new EditText(this);
|
||||
commentEditText.setSingleLine(true);
|
||||
|
||||
@ -50,20 +50,19 @@ public class WorkoutBuilder {
|
||||
|
||||
// Calculate values
|
||||
workout.start = start.getTimeInMillis();
|
||||
workout.duration = duration;
|
||||
workout.end = workout.start + workout.duration;
|
||||
|
||||
workout.id = workout.start;
|
||||
workout.setWorkoutType(workoutType);
|
||||
|
||||
workout.duration = duration;
|
||||
workout.pauseDuration = 0;
|
||||
|
||||
workout.length = length;
|
||||
|
||||
workout.avgSpeed = (double) length / (double) (duration / 1000);
|
||||
workout.topSpeed = 0;
|
||||
workout.avgPace = ((double) workout.duration / 1000 / 60) / ((double) workout.length / 1000);
|
||||
|
||||
workout.pauseDuration = 0;
|
||||
workout.ascent = 0;
|
||||
workout.descent = 0;
|
||||
|
||||
|
||||
@ -113,7 +113,6 @@
|
||||
<string name="workoutTypeUnknown">Unknown</string>
|
||||
<string name="type">Type</string>
|
||||
|
||||
<string name="custom">Custom</string>
|
||||
<string name="enterWorkout">Enter Workout</string>
|
||||
|
||||
<string name="setDuration">Set Duration</string>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user