forked from organicmaps/organicmaps
[android] Made StaticValueConverter generic
This commit is contained in:
parent
156a7850e3
commit
bb07dc576e
3 changed files with 9 additions and 9 deletions
|
@ -30,7 +30,7 @@ public class IntroductionDialogFragment extends BaseMwmDialogFragment
|
|||
fragment.show(fm, IntroductionDialogFragment.class.getName());
|
||||
Statistics.INSTANCE.trackEvent(Statistics.EventName.ONBOARDING_DEEPLINK_SCREEN_SHOW,
|
||||
Statistics.params().add(Statistics.EventParam.TYPE,
|
||||
factory.getStatisticalName()));
|
||||
factory.toStatisticValue()));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -72,7 +72,7 @@ public class IntroductionDialogFragment extends BaseMwmDialogFragment
|
|||
factory.createButtonClickListener().onIntroductionButtonClick(requireActivity(), deepLink);
|
||||
Statistics.INSTANCE.trackEvent(Statistics.EventName.ONBOARDING_DEEPLINK_SCREEN_ACCEPT,
|
||||
Statistics.params().add(Statistics.EventParam.TYPE,
|
||||
factory.getStatisticalName()));
|
||||
factory.toStatisticValue()));
|
||||
dismissAllowingStateLoss();
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class IntroductionDialogFragment extends BaseMwmDialogFragment
|
|||
super.onCancel(dialog);
|
||||
Statistics.INSTANCE.trackEvent(Statistics.EventName.ONBOARDING_DEEPLINK_SCREEN_DECLINE,
|
||||
Statistics.params().add(Statistics.EventParam.TYPE,
|
||||
getScreenFactory().getStatisticalName()));
|
||||
getScreenFactory().toStatisticValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,15 +9,15 @@ import com.mapswithme.maps.R;
|
|||
import com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity;
|
||||
import com.mapswithme.maps.bookmarks.BookmarksCatalogActivity;
|
||||
import com.mapswithme.maps.bookmarks.BookmarksPageFactory;
|
||||
import com.mapswithme.util.statistics.StatisticalNameProvider;
|
||||
import com.mapswithme.util.statistics.StatisticValueConverter;
|
||||
|
||||
public enum IntroductionScreenFactory implements StatisticalNameProvider
|
||||
public enum IntroductionScreenFactory implements StatisticValueConverter<String>
|
||||
{
|
||||
FREE_GUIDE
|
||||
{
|
||||
@NonNull
|
||||
@Override
|
||||
public String getStatisticalName()
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "catalogue";
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public enum IntroductionScreenFactory implements StatisticalNameProvider
|
|||
{
|
||||
@NonNull
|
||||
@Override
|
||||
public String getStatisticalName()
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "guides_page";
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.mapswithme.util.statistics;
|
|||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
public interface StatisticalNameProvider
|
||||
public interface StatisticValueConverter<T>
|
||||
{
|
||||
@NonNull
|
||||
public String getStatisticalName();
|
||||
T toStatisticValue();
|
||||
}
|
Loading…
Add table
Reference in a new issue