diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/bin/classes.dex b/mobile/com.sap.sailing.android.tracking.app.test-test/bin/classes.dex
index 1e09eea08ad..f8e98da06af 100644
Binary files a/mobile/com.sap.sailing.android.tracking.app.test-test/bin/classes.dex and b/mobile/com.sap.sailing.android.tracking.app.test-test/bin/classes.dex differ
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/bin/com.sap.sailing.android.tracking.app.test.apk b/mobile/com.sap.sailing.android.tracking.app.test-test/bin/com.sap.sailing.android.tracking.app.test.apk
index ee007c97167..95a3ea72468 100644
Binary files a/mobile/com.sap.sailing.android.tracking.app.test-test/bin/com.sap.sailing.android.tracking.app.test.apk and b/mobile/com.sap.sailing.android.tracking.app.test-test/bin/com.sap.sailing.android.tracking.app.test.apk differ
diff --git a/mobile/com.sap.sailing.android.tracking.app/res/values-de/strings.xml b/mobile/com.sap.sailing.android.tracking.app/res/values-de/strings.xml
index b2f86dd1879..bc6041c8e33 100644
--- a/mobile/com.sap.sailing.android.tracking.app/res/values-de/strings.xml
+++ b/mobile/com.sap.sailing.android.tracking.app/res/values-de/strings.xml
@@ -75,5 +75,6 @@
Bitte kontaktieren Sie die Rennleitung, falls Sie keinen QR-Code erhalten haben.
Tracke:
GPS Genauigkeit
+ Die Regatta findet gerade statt.
\ No newline at end of file
diff --git a/mobile/com.sap.sailing.android.tracking.app/res/values/strings.xml b/mobile/com.sap.sailing.android.tracking.app/res/values/strings.xml
index 97613433841..67225c183af 100644
--- a/mobile/com.sap.sailing.android.tracking.app/res/values/strings.xml
+++ b/mobile/com.sap.sailing.android.tracking.app/res/values/strings.xml
@@ -64,5 +64,6 @@
No QR-Code?
Please contact race management if you have not received a QR-Code.
Tracking:
+ The regatta is in progress.
diff --git a/mobile/com.sap.sailing.android.tracking.app/src/com/sap/sailing/android/tracking/app/ui/fragments/RegattaFragment.java b/mobile/com.sap.sailing.android.tracking.app/src/com/sap/sailing/android/tracking/app/ui/fragments/RegattaFragment.java
index 1c6fa30d547..4a7a585fa59 100644
--- a/mobile/com.sap.sailing.android.tracking.app/src/com/sap/sailing/android/tracking/app/ui/fragments/RegattaFragment.java
+++ b/mobile/com.sap.sailing.android.tracking.app/src/com/sap/sailing/android/tracking/app/ui/fragments/RegattaFragment.java
@@ -44,23 +44,18 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
- View view = inflater.inflate(R.layout.fragment_regatta, container,
- false);
+ View view = inflater.inflate(R.layout.fragment_regatta, container, false);
- Button startTrackingButton = (Button) view
- .findViewById(R.id.start_tracking);
+ Button startTrackingButton = (Button) view.findViewById(R.id.start_tracking);
startTrackingButton.setOnClickListener(this);
- Button changePhotoButton = (Button) view
- .findViewById(R.id.change_photo_button);
+ Button changePhotoButton = (Button) view.findViewById(R.id.change_photo_button);
changePhotoButton.setOnClickListener(this);
- ImageButton addPhotoButton = (ImageButton) view
- .findViewById(R.id.add_photo_button);
+ ImageButton addPhotoButton = (ImageButton) view.findViewById(R.id.add_photo_button);
addPhotoButton.setOnClickListener(this);
- TextView addPhotoText = (TextView) view
- .findViewById(R.id.add_photo_text);
+ TextView addPhotoText = (TextView) view.findViewById(R.id.add_photo_text);
addPhotoText.setOnClickListener(this);
return view;
@@ -74,6 +69,30 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
switchToThankYouScreen();
}
}
+
+ /**
+ * If the regatta started, don't display the countdown any more.
+ */
+ private void checkAndHideCountdownIfRegattaIsInProgress() {
+ TextView textView = (TextView)getActivity().findViewById(R.id.regatta_starts_in);
+
+ RegattaActivity regattaActivity = (RegattaActivity) getActivity();
+ long regattaStart = regattaActivity.getEventStartMillis();
+
+ LinearLayout threeBoxesLayout = (LinearLayout) getActivity()
+ .findViewById(R.id.three_boxes_regatta_starts);
+
+ if (System.currentTimeMillis() > regattaStart)
+ {
+ textView.setText(getString(R.string.regatta_in_progress));
+ threeBoxesLayout.setVisibility(View.INVISIBLE);
+ }
+ else
+ {
+ textView.setText(getString(R.string.regatta_starts_in));
+ threeBoxesLayout.setVisibility(View.VISIBLE);
+ }
+ }
private void switchToThankYouScreen() {
showingThankYouNote = true;
@@ -82,18 +101,14 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
.findViewById(R.id.start_date_layout);
startsInLayout.setVisibility(View.INVISIBLE);
- Button startTrackingButton = (Button) getActivity().findViewById(
- R.id.start_tracking);
- startTrackingButton.setBackgroundColor(getActivity().getResources()
- .getColor(R.color.sap_yellow));
+ Button startTrackingButton = (Button) getActivity().findViewById(R.id.start_tracking);
+ startTrackingButton.setBackgroundColor(getActivity().getResources().getColor(R.color.sap_yellow));
startTrackingButton.setText(getActivity().getString(R.string.close));
- TextView bottomAnnouncement = (TextView) getActivity().findViewById(
- R.id.bottom_announcement);
+ TextView bottomAnnouncement = (TextView) getActivity().findViewById(R.id.bottom_announcement);
bottomAnnouncement.setVisibility(View.INVISIBLE);
- RelativeLayout thankYouLayout = (RelativeLayout) getActivity()
- .findViewById(R.id.thank_you_layout);
+ RelativeLayout thankYouLayout = (RelativeLayout) getActivity().findViewById(R.id.thank_you_layout);
thankYouLayout.setVisibility(View.VISIBLE);
}
@@ -103,6 +118,7 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
timer = new TimerRunnable();
timer.start();
checkAndSwitchToThankYouScreenIfRegattaOver();
+ checkAndHideCountdownIfRegattaIsInProgress();
}
@Override
@@ -228,7 +244,7 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
private void updateCountdownTimer(long startTime) {
long diff = startTime - System.currentTimeMillis();
- if (diff < 0) // event is in the past
+ if (diff < 0) // start of event is in the past
{
setCountdownTime(0, 0, 0);
} else {