added comments and optimized code
This commit is contained in:
@@ -39,11 +39,10 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
private TextView exerciseNameTextView;
|
||||
private TextView exerciseShortDescriptionTextView;
|
||||
private TextView exerciseDescriptionTextView;
|
||||
private static String exerciseVideoUrl;
|
||||
|
||||
private final Object lock = new Object();
|
||||
|
||||
private static String exerciseVideoUrl;
|
||||
|
||||
// Some nice little messages for the user
|
||||
private static final String[] EXERCISE_NOT_FOUND_MESSAGES = new String[]{
|
||||
"Ik heb momenteel helaas wat moeite met het ophalen van oefeningen, sorry.",
|
||||
@@ -68,16 +67,14 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
this.exerciseNameTextView = findViewById(R.id.textViewFitnessTitle);
|
||||
//this.exerciseDescriptionTextView = findViewById(R.id.textViewDialogDescription);
|
||||
this.exerciseShortDescriptionTextView = findViewById(R.id.textViewFitnessShortDescription);
|
||||
// Remove the ugly ass bar on top of the view
|
||||
setSpeechBarDisplayStrategy(SpeechBarDisplayStrategy.IMMERSIVE);
|
||||
|
||||
// Find the VideoView by its ID
|
||||
|
||||
// Navigation Buttons
|
||||
NavigationManager.setupButtonNavigation(this, R.id.homeButtonFitness, MainActivity.class);
|
||||
NavigationManager.setupButtonNavigation(this, R.id.skipButtonFitness, MainActivity.class); //Needs to skip exercises once those are implemented
|
||||
|
||||
// Hide system UI
|
||||
NavigationManager.hideSystemUI(this);
|
||||
setSpeechBarDisplayStrategy(SpeechBarDisplayStrategy.IMMERSIVE);
|
||||
|
||||
// Initiate info button
|
||||
Button infoButtonFitness = findViewById(R.id.infoButtonFitness);
|
||||
@@ -85,7 +82,6 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showInfoDialog();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -121,8 +117,9 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
NavigationManager.navigateToActivity(this, EndScreenActivity.class);
|
||||
});
|
||||
});
|
||||
|
||||
// FitnessCycle.playVideo(qiContext, videoView, this);
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
Log.e("exerciseVideoUrl", "videoUrl:" + exerciseVideoUrl);
|
||||
playVideo(videoView, this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,20 +139,13 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
this.runOnUiThread(() -> {
|
||||
exerciseNameTextView.setText(exercise.name);
|
||||
exerciseShortDescriptionTextView.setText(exercise.shortDescription);
|
||||
exerciseNameTextView.setText(exercise.name);
|
||||
exerciseShortDescriptionTextView.setText(exercise.shortDescription);
|
||||
// exerciseDescriptionTextView.setText(exercise.description);
|
||||
// exerciseDescriptionTextView.setText(exercise.description);
|
||||
exerciseVideoUrl = exercise.videoUrl;
|
||||
// exerciseDescriptionTextView.setText(exercise.description);
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
Log.e("exerciseVideoUrl", "videourl:" + exerciseVideoUrl);
|
||||
playVideo(videoView, this);
|
||||
});
|
||||
}
|
||||
})).start();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function for playing a video in a VideoView
|
||||
*
|
||||
|
Reference in New Issue
Block a user