added sound effects

This commit is contained in:
SebasKoedam
2024-06-05 13:26:39 +02:00
parent 8547fa563f
commit cc46a109a6
3 changed files with 3 additions and 1 deletions

View File

@@ -260,7 +260,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
public void incrementProgress(View view) { public void incrementProgress(View view) {
if (progress < maxProgress) { if (progress < maxProgress) {
progress++; progress++;
triggerColorBurst(false); triggerColorBurst(true);
updateProgress(); updateProgress();
} }
} }
@@ -274,8 +274,10 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
if (isGoodRep) { if (isGoodRep) {
progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_good)); progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_good));
new MediaPlayer().create(this, R.raw.good_sound).start();
} else { } else {
progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_bad)); progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_bad));
new MediaPlayer().create(this, R.raw.wrong_sound).start();
} }
ObjectAnimator animator = ObjectAnimator.ofFloat(progressCircle, "alpha", 1f, 0f, 1f); ObjectAnimator animator = ObjectAnimator.ofFloat(progressCircle, "alpha", 1f, 0f, 1f);

Binary file not shown.

Binary file not shown.