Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java')
-rw-r--r--android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java b/android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java
index 55a36e5063..aec8f96b42 100644
--- a/android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java
+++ b/android/src/com/mapswithme/maps/maplayer/subway/TransitSchemeState.java
@@ -1,12 +1,32 @@
package com.mapswithme.maps.maplayer.subway;
import android.support.annotation.NonNull;
+import android.widget.Toast;
+
+import com.mapswithme.maps.MwmApplication;
+import com.mapswithme.maps.R;
+import com.mapswithme.util.statistics.Statistics;
public enum TransitSchemeState
{
DISABLED,
- ENABLED,
- NO_DATA;
+ ENABLED
+ {
+ @Override
+ public void onReceived(@NonNull MwmApplication app)
+ {
+ Statistics.INSTANCE.trackSubwayEvent(Statistics.ParamValue.SUCCESS);
+ }
+ },
+ NO_DATA
+ {
+ @Override
+ public void onReceived(@NonNull MwmApplication app)
+ {
+ Toast.makeText(app, R.string.subway_data_unavailable, Toast.LENGTH_SHORT).show();
+ Statistics.INSTANCE.trackSubwayEvent(Statistics.ParamValue.UNAVAILABLE);
+ }
+ };
@NonNull
public static TransitSchemeState makeInstance(int index)
@@ -15,4 +35,9 @@ public enum TransitSchemeState
throw new IllegalArgumentException("No value for index = " + index);
return TransitSchemeState.values()[index];
}
+
+ public void onReceived(@NonNull MwmApplication app)
+ {
+ /* Do nothing by default */
+ }
}