[android] Changed minimum rating for store redirection in amazon build.

This commit is contained in:
Dmitry Yunitsky 2015-07-24 20:04:34 +03:00 committed by Alex Zolotarev
parent b44a7095d0
commit f6b09302fb
5 changed files with 16 additions and 28 deletions

View file

@ -56,8 +56,8 @@ android {
applicationId 'com.mapswithme.maps.pro'
buildConfigField 'String', 'STATISTICS_URL', propStatisticsUrl
buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"'
buildConfigField 'String', 'REVIEW_URL', '"http://maps.me/"'
buildConfigField 'int', 'RATING_DIVISOR', '5'
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"'
buildConfigField 'int', 'RATING_THRESHOLD', '5'
}
sourceSets.main {
@ -72,7 +72,6 @@ android {
productFlavors {
google {
versionName = android.defaultConfig.versionName + '-Google'
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"'
buildConfigField 'String', 'SUPPORT_MAIL', '"googleplay@maps.me"'
}
@ -87,7 +86,7 @@ android {
versionName = android.defaultConfig.versionName + '-Amazon'
buildConfigField 'String', 'REVIEW_URL', '"amzn://apps/android?p=com.mapswithme.maps.pro"'
buildConfigField 'String', 'SUPPORT_MAIL', '"amazon@maps.me"'
buildConfigField 'int', 'RATING_DIVISOR', '4'
buildConfigField 'int', 'RATING_THRESHOLD', '4'
android.sourceSets.amazon.assets.srcDirs = ['flavors/mwm-ttf-assets']
}
@ -99,7 +98,6 @@ android {
preinstall {
versionName = android.defaultConfig.versionName + '-Preinstall'
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"'
buildConfigField 'String', 'SUPPORT_MAIL', '"googleplay@maps.me"'
}
@ -110,23 +108,23 @@ android {
xiaomi {
versionName = android.defaultConfig.versionName + '-Xiaomi'
buildConfigField 'String', 'REVIEW_URL', '"http://app.mi.com/detail/85835?ref=search"'
android.sourceSets.xiaomi.assets.srcDirs = ['flavors/mwm-ttf-assets']
}
lenovo {
versionName = android.defaultConfig.versionName + '-Lenovo'
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"'
android.sourceSets.lenovo.assets.srcDirs = ['flavors/mwm-ttf-assets']
}
web {
versionName = android.defaultConfig.versionName + '-Web'
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"'
android.sourceSets.web.assets.srcDirs = ['flavors/mwm-ttf-assets']
}
nineApp {
versionName = android.defaultConfig.versionName + '-9app'
buildConfigField 'String', 'REVIEW_URL', '"http://www.9apps.com/android-apps/mapswithme-maps-pro/"'
android.sourceSets.nineApp.assets.srcDirs = ['flavors/mwm-ttf-assets']
}
}

View file

@ -17,7 +17,6 @@ import com.mapswithme.util.Constants;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Yota;
import com.mapswithme.util.statistics.AlohaHelper;
import com.mapswithme.util.statistics.Statistics;
import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParseInstallation;
@ -296,7 +295,6 @@ public class MWMApplication extends android.app.Application implements ActiveCou
final int currentLaunches = nativeGetInt(LAUNCH_NUMBER_SETTING, 0);
if (currentLaunches == 0)
{
trackFirstLaunch();
nativeSetInt(FIRST_INSTALL_VERSION, BuildConfig.VERSION_CODE);
final String installedFlavor = getFirstInstallFlavor();
@ -318,11 +316,6 @@ public class MWMApplication extends android.app.Application implements ActiveCou
}
}
private void trackFirstLaunch()
{
Statistics.INSTANCE.trackFirstLaunch(BuildConfig.IS_PREINSTALLED, BuildConfig.FLAVOR);
}
/**
* @return total number of application launches
*/

View file

@ -59,7 +59,7 @@ public class RateStoreDialogFragment extends BaseMwmDialogFragment implements Vi
{
Statistics.INSTANCE.trackRatingDialog(rating);
mRating = rating;
if (rating == 5.0f)
if (rating >= BuildConfig.RATING_THRESHOLD)
{
LikesManager.setRatingApplied(RateStoreDialogFragment.class, true);
dismiss();

View file

@ -1,6 +1,7 @@
package com.mapswithme.util;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.Context;
import android.content.Intent;
@ -296,6 +297,14 @@ public class Utils
marketIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
else
marketIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(marketIntent);
try
{
activity.startActivity(marketIntent);
}
catch (ActivityNotFoundException e)
{
e.printStackTrace();
}
}
}

View file

@ -70,7 +70,6 @@ public enum Statistics
public static final String STATISTICS_STATUS_CHANGED = "Statistics status changed";
//
public static final String NO_FREE_SPACE = "Downloader. Not enough free space.";
public static final String APP_ACTIVATED = "Application activated.";
public static final String PLUS_DIALOG_LATER = "GPlus dialog cancelled.";
public static final String RATE_DIALOG_LATER = "GPlay dialog cancelled.";
public static final String FACEBOOK_INVITE_LATER = "Facebook invites dialog cancelled.";
@ -93,7 +92,6 @@ public enum Statistics
public static final String FG_TIME = "Foreground time";
public static final String PRO_STAT = "One time PRO stat";
public static final String ENABLED = "Enabled";
public static final String IS_PREINSTALLED = "IsPreinstalled";
public static final String APP_FLAVOR = "Flavor";
public static final String RATING = "Rating";
}
@ -250,16 +248,6 @@ public enum Statistics
trackIfEnabled(event);
}
public void trackFirstLaunch(boolean isPreinstalled, String flavor)
{
final Event event = mEventBuilder.
setName(EventName.APP_ACTIVATED).
addParam(EventParam.IS_PREINSTALLED, String.valueOf(isPreinstalled)).
addParam(EventParam.APP_FLAVOR, flavor).
buildEvent();
trackIfEnabled(event);
}
public void trackDownloadCountryNotificationShown()
{
trackIfEnabled(mEventBuilder.setName(EventName.DOWNLOAD_COUNTRY_NOTIFICATION_SHOWN).buildEvent());