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-04-19 18:26:57 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2018-04-25 15:38:50 +0300
commit5a69bebf8adbf4898b23b2f731c275c599f72a60 (patch)
treebe6b92d8e71f0a52fa756f69c12429664147403a /android/src
parent11c74d704f9b6341620ac1576648618a7073cc86 (diff)
[android] Fixed statistics for category shown
Diffstat (limited to 'android/src')
-rw-r--r--android/src/com/mapswithme/maps/search/CategoriesAdapter.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/android/src/com/mapswithme/maps/search/CategoriesAdapter.java b/android/src/com/mapswithme/maps/search/CategoriesAdapter.java
index 39e05c8304..275d80ea63 100644
--- a/android/src/com/mapswithme/maps/search/CategoriesAdapter.java
+++ b/android/src/com/mapswithme/maps/search/CategoriesAdapter.java
@@ -2,7 +2,6 @@ package com.mapswithme.maps.search;
import android.content.res.Resources;
import android.support.annotation.DrawableRes;
-import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
@@ -50,21 +49,18 @@ class CategoriesAdapter extends RecyclerView.Adapter<CategoriesAdapter.ViewHolde
String key = keys[i];
mCategoryResIds[i] = resources.getIdentifier(key, "string", packageName);
- if (mCategoryResIds[i] == 0)
+ PromoCategory promo = PromoCategory.findByKey(key);
+ if (promo != null)
{
- PromoCategory category = PromoCategory.findByKey(key);
- if (category != null)
- {
- Statistics.INSTANCE.trackSponsoredEventForCustomProvider(
- Statistics.EventName.SEARCH_SPONSOR_CATEGORY_SHOWN,
- category.getStatisticValue());
- mCategoryResIds[i] = category.getStringId();
- }
-
- if (mCategoryResIds[i] == 0)
- throw new IllegalStateException("Can't get string resource id for category:" + key);
+ Statistics.INSTANCE.trackSponsoredEventForCustomProvider(
+ Statistics.EventName.SEARCH_SPONSOR_CATEGORY_SHOWN,
+ promo.getStatisticValue());
+ mCategoryResIds[i] = promo.getStringId();
}
+ if (mCategoryResIds[i] == 0)
+ throw new IllegalStateException("Can't get string resource id for category:" + key);
+
String iconId = "ic_category_" + key;
if (isNightTheme)
iconId = iconId + "_night";