This commit is contained in:
2024-06-05 18:00:36 +02:00
parent 5537230b49
commit ff61ba4645
2 changed files with 4 additions and 11 deletions

View File

@@ -90,9 +90,6 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
progressText = findViewById(R.id.progressText); progressText = findViewById(R.id.progressText);
progressCircle.setMax(maxProgress); progressCircle.setMax(maxProgress);
// Play the video
playVideo(videoView, this);
// Set color of loading circle // Set color of loading circle
ProgressBar loadingCircle = findViewById(R.id.loadingCircle); ProgressBar loadingCircle = findViewById(R.id.loadingCircle);
loadingCircle.setIndeterminateTintList(ColorStateList.valueOf(Color.RED)); loadingCircle.setIndeterminateTintList(ColorStateList.valueOf(Color.RED));
@@ -205,7 +202,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
public void playVideo(VideoView videoView, Context context) { public void playVideo(VideoView videoView, Context context) {
// Set up the video player // Set up the video player
if (videoView != null) { if (videoView != null) {
videoView.setVideoPath(exerciseVideoUrl); videoView.setVideoURI(Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.arm_raises));
videoView.start(); videoView.start();
} else { } else {
Log.e("FitnessActivity", "VideoView is null. Check your layout XML."); Log.e("FitnessActivity", "VideoView is null. Check your layout XML.");

View File

@@ -110,7 +110,8 @@ public class InputProcessor {
if ( this.totalChecks == 0 || this.selfRotationVectorPaths == null if ( this.totalChecks == 0 || this.selfRotationVectorPaths == null
|| this.selfRotationVectorPaths.length == 0 || this.selfRotationVectorPaths.length == 0
|| this.selfRotationVectorPaths[0].size() == 0) || this.selfRotationVectorPaths[0].size() == 0
|| this.selfRotationVectorPaths[1].size() == 0)
continue; continue;
boolean isFaulty = this.isFaultyMovement(); boolean isFaulty = this.isFaultyMovement();
@@ -145,7 +146,7 @@ public class InputProcessor {
* @param exercise The exercise to move on to. * @param exercise The exercise to move on to.
*/ */
private void nextExercise(Exercise exercise) { private void nextExercise(Exercise exercise) {
//TODO: Remove when more than one exercise
if (this.exercisesRemaining <= 0) { if (this.exercisesRemaining <= 0) {
Log.i("InputProcessor", "Moving to end screen; finished all exercises"); Log.i("InputProcessor", "Moving to end screen; finished all exercises");
// Move to end screen on main activity // Move to end screen on main activity
@@ -426,11 +427,6 @@ public class InputProcessor {
int i, referenceIndex; int i, referenceIndex;
float distance; float distance;
if (selfRotationVectorPaths == null ||
this.selfRotationVectorPaths.length == 0 ||
this.selfRotationVectorPaths[0].size() == 0)
return true;
for (i = 0; i < selfRotationVectorPaths.length; i++) { for (i = 0; i < selfRotationVectorPaths.length; i++) {
referenceIndex = (int) (Math.round( referenceIndex = (int) (Math.round(
((this.secondsPassed % this.exerciseRepetitionDurationInSeconds) / ((this.secondsPassed % this.exerciseRepetitionDurationInSeconds) /