From ff61ba46456936b8902053b8e781d8ab7ef1642b Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Wed, 5 Jun 2024 18:00:36 +0200 Subject: [PATCH] yes --- .../example/fitbot/ui/activities/FitnessActivity.java | 5 +---- .../example/fitbot/util/processing/InputProcessor.java | 10 +++------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java index 4b5cc40..439f34d 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java @@ -90,9 +90,6 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall progressText = findViewById(R.id.progressText); progressCircle.setMax(maxProgress); - // Play the video - playVideo(videoView, this); - // Set color of loading circle ProgressBar loadingCircle = findViewById(R.id.loadingCircle); loadingCircle.setIndeterminateTintList(ColorStateList.valueOf(Color.RED)); @@ -205,7 +202,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall public void playVideo(VideoView videoView, Context context) { // Set up the video player if (videoView != null) { - videoView.setVideoPath(exerciseVideoUrl); + videoView.setVideoURI(Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.arm_raises)); videoView.start(); } else { Log.e("FitnessActivity", "VideoView is null. Check your layout XML."); diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/InputProcessor.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/InputProcessor.java index 30f9139..2c64a06 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/InputProcessor.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/InputProcessor.java @@ -110,7 +110,8 @@ public class InputProcessor { if ( this.totalChecks == 0 || this.selfRotationVectorPaths == null || this.selfRotationVectorPaths.length == 0 - || this.selfRotationVectorPaths[0].size() == 0) + || this.selfRotationVectorPaths[0].size() == 0 + || this.selfRotationVectorPaths[1].size() == 0) continue; boolean isFaulty = this.isFaultyMovement(); @@ -145,7 +146,7 @@ public class InputProcessor { * @param exercise The exercise to move on to. */ private void nextExercise(Exercise exercise) { - + //TODO: Remove when more than one exercise if (this.exercisesRemaining <= 0) { Log.i("InputProcessor", "Moving to end screen; finished all exercises"); // Move to end screen on main activity @@ -426,11 +427,6 @@ public class InputProcessor { int i, referenceIndex; float distance; - if (selfRotationVectorPaths == null || - this.selfRotationVectorPaths.length == 0 || - this.selfRotationVectorPaths[0].size() == 0) - return true; - for (i = 0; i < selfRotationVectorPaths.length; i++) { referenceIndex = (int) (Math.round( ((this.secondsPassed % this.exerciseRepetitionDurationInSeconds) /