chore: Update activity_fitness.xml layout and fix bug in ExerciseManager
This commit is contained in:
@@ -85,7 +85,7 @@ public class ExerciseManager {
|
||||
*/
|
||||
public static Exercise fetchExerciseFromDatabase() {
|
||||
String response = sendHTTP(
|
||||
HOST_ADDRESS, "POST", "application/json",
|
||||
HOST_ADDRESS, "POST", "application/json", null
|
||||
);
|
||||
// Validate the response
|
||||
if (response != null) {
|
||||
|
@@ -63,8 +63,10 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
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);
|
||||
|
||||
// Initiate info button
|
||||
Button infoButtonFitness = findViewById(R.id.infoButtonFitness);
|
||||
infoButtonFitness.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -96,6 +98,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
|
||||
motionProcessor.startListening();
|
||||
motionProcessor.setInputHandler(personalMotionPreviewElement);
|
||||
|
||||
}, (n) -> {
|
||||
int randomMessageIndex = (int) Math.floor(Math.random() * EXERCISE_NOT_FOUND_MESSAGES.length);
|
||||
Pepper.say(EXERCISE_NOT_FOUND_MESSAGES[randomMessageIndex]);
|
||||
@@ -177,12 +180,15 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
final Dialog dialog = new Dialog(this);
|
||||
dialog.setContentView(R.layout.dialog_info);
|
||||
|
||||
// Hide the system UI
|
||||
NavigationManager.hideSystemUI(this);
|
||||
|
||||
// Set the dialog options
|
||||
dialog.getWindow().setDimAmount(0.5f);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
||||
dialog.setCancelable(true);
|
||||
|
||||
// Close button for dialog
|
||||
Button closeButton = dialog.findViewById(R.id.closeButtonDialog);
|
||||
closeButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user