proper time formatting

This commit is contained in:
Harrison Deng 2017-12-03 20:04:33 -06:00
parent 516ed746d7
commit 72b91a53fe

View File

@ -256,6 +256,10 @@ public class MusicSelectionPage extends Page implements Observer {
public void setCurrentlySelected(MusicSelectable currentlySelected) {
this.currentlySelected = currentlySelected;
songSelectionTimer = 1f;
if (extraInfoDone) {
updateInformation();
}
}
private void scrollDown() {
@ -299,9 +303,6 @@ public class MusicSelectionPage extends Page implements Observer {
private void setCurrentMusic() {
playSelectedMusic();
if (extraInfoDone) {
updateInformation();
}
}
private void playSelectedMusic() {
@ -319,7 +320,7 @@ public class MusicSelectionPage extends Page implements Observer {
long lengthInSeconds = currentlySelected.getAudioInfo().getDurationInSeconds();
int min = (int) (lengthInSeconds/60);
int sec = (int) (lengthInSeconds - (min*60));
songLength.setText("Length: " + min + ":" + sec);
songLength.setText("Length: " + min + ":" + (sec > 9 ? sec : "0" + sec));
previousTop.setText("Highscore: " + currentlySelected.getAudioInfo().getPreviousTop());