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:
authorAlexander Zatsepin <az@mapswithme.com>2018-08-06 15:55:15 +0300
committerAleksey Belousov <beloal@users.noreply.github.com>2018-08-10 20:16:14 +0300
commitc530a37729af88b455073dead352ae40a6f7be79 (patch)
treee0a10e1514c929bf3581360ec0eca63abc44bf72 /android/src
parent26b97dc4be39d9b4ddb66d333b09effc9a0a8062 (diff)
[android] Added statistics for downloaded bookmark popup
Diffstat (limited to 'android/src')
-rw-r--r--android/src/com/mapswithme/maps/MwmActivity.java4
-rw-r--r--android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java11
-rw-r--r--android/src/com/mapswithme/util/statistics/Statistics.java12
3 files changed, 27 insertions, 0 deletions
diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java
index b62d792324..af12af401d 100644
--- a/android/src/com/mapswithme/maps/MwmActivity.java
+++ b/android/src/com/mapswithme/maps/MwmActivity.java
@@ -1196,7 +1196,11 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onImportFinished(@NonNull String serverId, long catId, boolean successful)
{
+ if (!successful)
+ return;
+
Toast.makeText(this, R.string.bookmarks_downloaded_title, Toast.LENGTH_LONG).show();
+ Statistics.INSTANCE.trackEvent(Statistics.EventName.BM_GUIDEDOWNLOADTOAST_SHOWN);
}
@Override
diff --git a/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java b/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java
index e10811c68f..f7e6bc2cc7 100644
--- a/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java
@@ -1,6 +1,7 @@
package com.mapswithme.maps.bookmarks;
import android.app.Activity;
+import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
@@ -12,6 +13,7 @@ import android.view.ViewGroup;
import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.data.BookmarkCategory;
+import com.mapswithme.util.statistics.Statistics;
public class ShowOnMapCatalogCategoryFragment extends DialogFragment
{
@@ -55,11 +57,13 @@ public class ShowOnMapCatalogCategoryFragment extends DialogFragment
private void onDeclined()
{
+ Statistics.INSTANCE.trackDownloadBookmarkDialog(Statistics.ParamValue.NOT_NOW);
dismissAllowingStateLoss();
}
private void onAccepted()
{
+ Statistics.INSTANCE.trackDownloadBookmarkDialog(Statistics.ParamValue.VIEW_ON_MAP);
Intent result = new Intent().putExtra(BookmarksCatalogActivity.EXTRA_DOWNLOADED_CATEGORY,
mCategory);
getActivity().setResult(Activity.RESULT_OK, result);
@@ -67,6 +71,13 @@ public class ShowOnMapCatalogCategoryFragment extends DialogFragment
getActivity().finish();
}
+ @Override
+ public void onCancel(DialogInterface dialog)
+ {
+ super.onCancel(dialog);
+ Statistics.INSTANCE.trackDownloadBookmarkDialog(Statistics.ParamValue.CLICK_OUTSIDE);
+ }
+
void setCategory(@NonNull BookmarkCategory category)
{
mCategory = category;
diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java
index 508c6d4d15..91db8f9a54 100644
--- a/android/src/com/mapswithme/util/statistics/Statistics.java
+++ b/android/src/com/mapswithme/util/statistics/Statistics.java
@@ -53,6 +53,7 @@ import static com.mapswithme.util.BatteryState.CHARGING_STATUS_PLUGGED;
import static com.mapswithme.util.BatteryState.CHARGING_STATUS_UNKNOWN;
import static com.mapswithme.util.BatteryState.CHARGING_STATUS_UNPLUGGED;
import static com.mapswithme.util.statistics.Statistics.EventName.APPLICATION_COLD_STARTUP_INFO;
+import static com.mapswithme.util.statistics.Statistics.EventName.BM_GUIDES_DOWNLOADDIALOGUE_CLICK;
import static com.mapswithme.util.statistics.Statistics.EventName.BM_RESTORE_PROPOSAL_CLICK;
import static com.mapswithme.util.statistics.Statistics.EventName.BM_RESTORE_PROPOSAL_ERROR;
import static com.mapswithme.util.statistics.Statistics.EventName.BM_RESTORE_PROPOSAL_SUCCESS;
@@ -82,6 +83,7 @@ import static com.mapswithme.util.statistics.Statistics.EventName.UGC_AUTH_ERROR
import static com.mapswithme.util.statistics.Statistics.EventName.UGC_AUTH_EXTERNAL_REQUEST_SUCCESS;
import static com.mapswithme.util.statistics.Statistics.EventName.UGC_AUTH_SHOWN;
import static com.mapswithme.util.statistics.Statistics.EventName.UGC_REVIEW_START;
+import static com.mapswithme.util.statistics.Statistics.EventParam.ACTION;
import static com.mapswithme.util.statistics.Statistics.EventParam.BANNER;
import static com.mapswithme.util.statistics.Statistics.EventParam.BATTERY;
import static com.mapswithme.util.statistics.Statistics.EventParam.BUTTON;
@@ -191,6 +193,8 @@ public enum Statistics
static final String BM_TAB_CLICK = "Bookmarks_Tab_click";
private static final String BM_DOWNLOADED_CATALOGUE_OPEN = "Bookmarks_Downloaded_Catalogue_open";
private static final String BM_DOWNLOADED_CATALOGUE_ERROR = "Bookmarks_Downloaded_Catalogue_error";
+ public static final String BM_GUIDEDOWNLOADTOAST_SHOWN = "Bookmarks_GuideDownloadToast_shown";
+ public static final String BM_GUIDES_DOWNLOADDIALOGUE_CLICK = "Bookmarks_Guides_DownloadDialogue_click";
// search
public static final String SEARCH_CAT_CLICKED = "Search. Category clicked";
@@ -456,6 +460,9 @@ public enum Statistics
static final String BICYCLE = "bicycle";
static final String TAXI = "taxi";
static final String TRANSIT = "transit";
+ public final static String VIEW_ON_MAP = "view on map";
+ public final static String NOT_NOW = "not now";
+ public final static String CLICK_OUTSIDE = "click outside pop-up";
}
// Initialized once in constructor and does not change until the process restarts.
@@ -1276,6 +1283,11 @@ public enum Statistics
trackEvent(TOOLBAR_MENU_CLICK, getToolbarParams(button));
}
+ public void trackDownloadBookmarkDialog(@NonNull String button)
+ {
+ trackEvent(BM_GUIDES_DOWNLOADDIALOGUE_CLICK, params().add(ACTION, button));
+ }
+
@NonNull
private static ParameterBuilder getToolbarParams(@NonNull MainMenu.Item button)
{