mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 15:57:11 +00:00
# FinishedFragment shows Time Limit
This commit is contained in:
1 parent
063eb58a33
commit
9af8648107
1 file changed
+10
-1
+10
-1
@@ -68,8 +68,17 @@ public class FinishedRaceFragment extends RaceFragment {
|
||||
return getString(R.string.empty);
|
||||
}
|
||||
|
||||
private TimePoint getTimeLimit() {
|
||||
TimePoint startTime = getRace().getState().getStartTime();
|
||||
TimePoint firstBoatTime = getRace().getState().getFinishingStartTime();
|
||||
if (startTime == null || firstBoatTime == null) {
|
||||
return null;
|
||||
}
|
||||
return firstBoatTime.plus((long)((firstBoatTime.asMillis() - startTime.asMillis()) * 0.75));
|
||||
}
|
||||
|
||||
private CharSequence getTimeLimitText() {
|
||||
TimePoint timeLimit = null;
|
||||
TimePoint timeLimit = getTimeLimit();
|
||||
if (timeLimit != null) {
|
||||
return String.format("%s %s", getString(R.string.race_time_limit),
|
||||
getFormattedTime(timeLimit.asDate()));
|
||||
|
||||
Reference in new issue
Block a user