added sound effects
This commit is contained in:
@@ -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);
|
||||||
|
BIN
code/src/Fitbot/app/src/main/res/raw/good_sound.mp3
Normal file
BIN
code/src/Fitbot/app/src/main/res/raw/good_sound.mp3
Normal file
Binary file not shown.
BIN
code/src/Fitbot/app/src/main/res/raw/wrong_sound.wav
Normal file
BIN
code/src/Fitbot/app/src/main/res/raw/wrong_sound.wav
Normal file
Binary file not shown.
Reference in New Issue
Block a user