Android Open Source - BarrelRace Timer Util






From Project

Back to project page BarrelRace.

License

The source code is released under:

MIT License

If you think the Android project BarrelRace listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.app.ui.assignment.barrelrace.util;
//from ww w .jav  a  2 s  .  c  om
/**
* @author Vasu Irneni
* @description Barrel Race Game for Android
* @module TimerUtil
*/

/*Format Time based on the elapsedTime value*/
public class TimerUtil {
        
    public String formatTime(long timeElapsed) {
        int timeDiff = (int) (timeElapsed/1000);
        int minutes = timeDiff/60;
        int seconds = timeDiff % 60;
        int milliseconds = (int) (timeElapsed % 1000);

        return minutes + ":" + String.format("%02d", seconds) 
                + ":" + String.format("%03d", milliseconds);
    }
}




Java Source Code List

com.app.ui.assignment.barrelrace.FailureActivity.java
com.app.ui.assignment.barrelrace.GameActivity.java
com.app.ui.assignment.barrelrace.MainActivity.java
com.app.ui.assignment.barrelrace.SettingsActivity.java
com.app.ui.assignment.barrelrace.SuccessActivity.java
com.app.ui.assignment.barrelrace.ViewScoresActivity.java
com.app.ui.assignment.barrelrace.objects.Barrel.java
com.app.ui.assignment.barrelrace.objects.Fence.java
com.app.ui.assignment.barrelrace.objects.Horse.java
com.app.ui.assignment.barrelrace.objects.Score.java
com.app.ui.assignment.barrelrace.util.CustomAdapter.java
com.app.ui.assignment.barrelrace.util.FileUtil.java
com.app.ui.assignment.barrelrace.util.ScoreComparator.java
com.app.ui.assignment.barrelrace.util.TimerUtil.java
com.app.ui.assignment.barrelrace.views.BarrelRaceView.java